-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Description
For troubleshooting purpose it is often useful to log a stack trace when a process is stuck in an abnormal state. AFAICT with gunicorn asynchronous workers, there is no good way to do that. In geoadmin/service-stac#558 we implemented our own worker class to override handle_exit and dump the stacks there. However that means we get stack traces for graceful terminations too. It would be nice if we could have a way to do that only when the worker exceeds the graceful_timeout upon termination.
One way to resolve this:
- SIGTERM triggers graceful termination
- wait graceful_timeout
- (new) if worker has not completed, trigger a quick shutdown (SIGTINT/SIGQUIT) (handle_quit can be implemented to dump the stacks)
- (new) wait quick_shutdown_timeout (new setting)
- SIGKILL
The way Arbiter.stop is implemented currently, the worker only ever receive SIGTERM or SIGQUIT but never both.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels