Skip to content

feat: add SIGUSR1/SIGUSR2 reinit signals#880

Open
marxus wants to merge 4 commits into
flant:mainfrom
marxus:feat/signal-reinit
Open

feat: add SIGUSR1/SIGUSR2 reinit signals#880
marxus wants to merge 4 commits into
flant:mainfrom
marxus:feat/signal-reinit

Conversation

@marxus
Copy link
Copy Markdown

@marxus marxus commented May 19, 2026

Summary

  • SIGUSR1 — soft reinit: reloads hook configs, restarts kubernetes watchers and schedules, skips onStartup hooks
  • SIGUSR2 — full reset: same as SIGUSR1 but also re-runs onStartup hooks, emulating a process restart without interrupting in-flight executions
  • On any --config failure during reinit the process exits with code 1
  • Adds unit tests for both soft reinit and full reset paths

Test plan

  • go test ./pkg/shell-operator/...
  • Run shell-operator, send kill -USR1 <pid>, verify hooks reload in logs without onStartup re-running
  • Run shell-operator, send kill -USR2 <pid>, verify full reload including onStartup hooks
  • Introduce a bad hook config, send either signal, verify process exits non-zero

🤖 Generated with Claude Code

marxus and others added 4 commits May 19, 2026 23:06
SIGUSR1 - soft reinit: disables existing bindings, reloads hook configs,
re-enables kubernetes watchers and schedules. onStartup hooks do not re-run.

SIGUSR2 - full reset: same as SIGUSR1 but also re-runs onStartup hooks,
emulating a process restart without interrupting in-flight executions.

On any --config failure during reinit the process exits with code 1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Verifies that SIGUSR1 (fullReset=false) does not re-enqueue onStartup tasks
and that SIGUSR2 (fullReset=true) does, while both enqueue binding-enable tasks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Captures controller pointers before Reinit and verifies they are new
instances after, proving the disable+rebuild cycle ran.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant