-
Notifications
You must be signed in to change notification settings - Fork 572
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
Graceful shutdown #243
Graceful shutdown #243
Conversation
* `exec` exit code is now preserved. * Improved process check for `connect`. * Relay signals to child process in `exec`.
# Conflicts: # pkg/cli/server_unix.go # pkg/server/controller.go # pkg/storage/local.go # pkg/storage/storage.go # pkg/util/atexit/atexit.go
Codecov Report
@@ Coverage Diff @@
## main #243 +/- ##
==========================================
- Coverage 54.64% 54.12% -0.51%
==========================================
Files 86 87 +1
Lines 3606 3631 +25
==========================================
- Hits 1970 1965 -5
- Misses 1431 1467 +36
+ Partials 205 199 -6
Continue to review full report at Codecov.
|
// Normally, if the program ran, the call should return ExitError and | ||
// the exit code must be preserved. Otherwise, the error originates from | ||
// pyroscope and will be printed. | ||
if e, ok := err.(*goexec.ExitError); ok { |
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.
👍
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.
It is so much better now, love it!
} | ||
|
||
func (svc *serverService) Start() error { | ||
g, ctx := errgroup.WithContext(context.Background()) |
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.
👍🏼
This pull request is aimed to improve pyroscope shutdown and initialisation.
controller
(http server) is drained at the very beginning of the shutdown to prevent storage reads and writes. Diagnostic endpoints (healthz, metrics, pprof) are handled till the storage closes, thus allowing clean exit.IsClosing
check fromstorage
: it is guaranteed that no calls to storage will be made afterClose
.atexit
package was removed.