Skip to content

Notify workers of quick shutdown after graceful shutdown times out. #3388

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adk-swisstopo
Copy link

As per #3385 this allows to distinguish between graceful and abnormal termination and gives a chance to workers to do something about it (e.g. to log a stack trace).

For backward compatibility, we keep the old 2 signals model if quick_shutdown_timeout is set to 0.

As per benoitc#3385 this allows to
distinguish between graceful and abnormal termination and gives a chance to
workers to do something about it (e.g. to log a stack trace).

For backward compatibility, we keep the old 2 signals model if
quick_shutdown_timeout is set to 0.
@pajod
Copy link
Contributor

pajod commented Apr 16, 2025

I like it, completely alleviates the concern that people might have depended on the previous behavior.


Note to reviewers: This patch carefully retains two questionable behaviors, which should probably be changed separately:

  • the undocumented (and annoying, in CI-tests) minimum shutdown delay of 0.1 seconds
  • the use of time.time() where time.monotonic() would be appropriate

name = "quick_shutdown_timeout"
section = "Worker Processes"
cli = ["--quick-shutdown-timeout"]
meta = "INT"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: point out the unit somewhere, possibly right here, where INT is misleading for a float option.
(meta[var] is just a text label anyway, so even SECONDS would be more clear about what is to be specified here)

Copy link
Author

Choose a reason for hiding this comment

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

Let's resolve this for graceful_timeout first :) #3390

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.

2 participants