-
Notifications
You must be signed in to change notification settings - Fork 6.5k
fix: properly handle shutdown signal for admin dashboard #23231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: properly handle shutdown signal for admin dashboard #23231
Conversation
This PR should enable the clean shutdown of the admin dashboard instead of needing to `kill -9` it. Fixes argoproj#22758. Signed-off-by: Blake Pettersson <[email protected]>
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #23231 +/- ##
==========================================
+ Coverage 59.98% 60.06% +0.07%
==========================================
Files 343 341 -2
Lines 57890 57879 -11
==========================================
+ Hits 34727 34763 +36
+ Misses 20381 20342 -39
+ Partials 2782 2774 -8 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Blake Pettersson <[email protected]>
Signed-off-by: Blake Pettersson <[email protected]>
Signed-off-by: Blake Pettersson <[email protected]>
| fmt.Printf("Argo CD UI is available at http://%s:%d\n", config.Address, config.Port) | ||
| <-ctx.Done() | ||
| println("signal received, shutting down dashboard") | ||
| cancel() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe unnecessary? We already have a defer cancel. And I think we can only hit this line if the context is "done" anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I was initially thinking as well, but according to the docs of signal.NotifyContext stop() should be called as soon as the context is done, which unregisters the signal handlers.
* add assertion in test * rename `cancel()` to `stop()` to align with notifycontext conventions Signed-off-by: Blake Pettersson <[email protected]>
Signed-off-by: Blake Pettersson <[email protected]>
Signed-off-by: Blake Pettersson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
) Signed-off-by: Blake Pettersson <[email protected]> Signed-off-by: dsuhinin <[email protected]>
) Signed-off-by: Blake Pettersson <[email protected]> Signed-off-by: enneitex <[email protected]>
This PR should enable the clean shutdown of the admin dashboard instead of needing to
kill -9it. Fixes #22758.Checklist: