Skip to content
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: don't use a finished context for graceful shutdown #20355

Merged
merged 5 commits into from
Dec 17, 2020

Conversation

danxmoran
Copy link
Contributor

Part of #19976

Ayan noticed in a separate PR that we were misusing ctx values here, resulting in an immediate timeout of our graceful-shutdown code. Splitting out the fix to make it easy to review.

@danxmoran danxmoran merged commit 6ed1922 into master Dec 17, 2020
@danxmoran danxmoran deleted the dm-graceful-shutdown-ctx-fix branch December 17, 2020 02:56
if err := l.run(ctx, o); err != nil {

// Start the launcher and wait for it to exit on SIGINT or SIGTERM.
runCtx := signals.WithStandardSignals(ctx)
Copy link
Contributor

@ayang64 ayang64 Feb 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why assign this to runCtx and not simply:

ctx = signals.WithStandardSignals(ctx)

also, if you're using go 1.15, i think you can use os/signal.NotifyContext().
?

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.

None yet

3 participants