1.19 Regression: It's impossible to shutdown from an OS signal after `startCtx` is `Done()`.
aureliar8 opened this issue · 2 comments
Describe the bug
Regression: It's impossible to shutdown from an OS signal after startCtx
is Done()
.
To Reproduce
- Start an fx app
- Wait
startTimeout
(default is 15s). - Send SIGTERM to the process
- Nothing will handle the signal and the app will not shut down
Expected behavior
The apps shut down correctly like it did in the previous release.
Additional context
This line starts the goroutine that dispatches os signals.
Line 118 in 213eb86
The goroutine then blocks on
Lines 82 to 95 in 213eb86
After the startCtx
is Done()
, this goroutine exits and thus there's nothing to process OS signals to initiate shutdown.
Replacing the goroutine invocation by go recv.relayer(context.TODO())
fixed the issue for me. The context passed here should not be Done()
until the application stops.
I have the same issue with Fx v1.19.0, it can't shutdown with Ctrl+C signal (-INT)
Fx v1.18.2 works well.
Thanks for reporting this issue folks and sorry about that regression. Will shortly roll out a patch release that addresses this issue.