Skip to content

Fix manager hanging on shutdown#7057

Open
pingsutw wants to merge 1 commit intov2from
fix-graceful-shutdown
Open

Fix manager hanging on shutdown#7057
pingsutw wants to merge 1 commit intov2from
fix-graceful-shutdown

Conversation

@pingsutw
Copy link
Member

@pingsutw pingsutw commented Mar 19, 2026

Summary

  • Fix the manager process hanging indefinitely on Ctrl+C by adding wg.Wait() with a 30-second timeout for worker goroutines
  • Support force exit on a second SIGINT/SIGTERM signal, matching the common Go pattern used by controller-runtime and Kubernetes components
  • Make HTTP server shutdown errors non-fatal so the rest of the shutdown sequence (worker cleanup) still runs

Test plan

The graceful shutdown sequence was missing wg.Wait() for worker
goroutines, and had no overall deadline. This caused the process to
hang indefinitely when workers (e.g. controller-runtime manager) were
slow to stop, requiring repeated Ctrl+C.

- Wait for all workers to finish with a 30s timeout
- Support force exit on second SIGINT/SIGTERM
- Make HTTP server shutdown errors non-fatal so worker cleanup still runs

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
@pingsutw pingsutw self-assigned this Mar 19, 2026
@github-actions github-actions bot mentioned this pull request Mar 19, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant