You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4ffc46f
Browse filesBrowse the repository at this point in the historyBrowse files
fix(receiver): preserve task finalization during shutdown
- Defer shutdown cancellation during dependency teardown and executor calls.
- Preserve cancellation across nested execution without interrupting cleanup.
- Cover thread and process executors, retries, and reentrant finalization.
- Clarify graceful shutdown limits and per-worker hard-kill handling.
Copy file name to clipboardExpand all lines: docs/guide/cli.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -146,10 +146,10 @@ kill -HUP <main pid>
146
146
If you send `SIGINT` or `SIGTERM` to the main process by pressing <kbd>Ctrl</kbd>+<kbd>C</kbd> or using the `kill` command, it will initiate the shutdown process.
147
147
By default, it will stop fetching new messages immediately after receiving the signal but will wait for the completion of all currently executing tasks.
148
148
149
-
If you don't want to wait indefinitely for tasks to complete, configure `--wait-tasks-timeout` to set their graceful completion period. Once that period expires, the worker requests cancellation of asynchronous task callbacks that are still running and waits for their cleanup before continuing shutdown. Synchronous functions already running in a thread or process executor cannot be forcibly stopped by asyncio cancellation and may continue until the executor shuts down. This is not an absolute process deadline; repeat the termination signal until the configured hard-kill threshold is reached if the process must stop immediately.
149
+
If you don't want to wait indefinitely for tasks to complete, configure `--wait-tasks-timeout` to set their graceful completion period. Once that period expires, the worker requests cancellation of asynchronous task callbacks that are still running and awaits their completion before continuing shutdown. Synchronous functions already running in a thread or process executor cannot be forcibly stopped by asyncio cancellation. Shutdown cancellation is deferred while awaiting such a call so that task dependencies remain usable until the function returns. This is not an absolute process deadline. Enforce a hard deadline through your process supervisor, with forced termination configured for the worker processes and their executor subprocesses; forced termination does not guarantee task cleanup.
150
150
151
151
::: tip Cool tip
152
-
The number of signals before a hard kill can be configured with the `--hardkill-count` CLI argument.
152
+
The `--hardkill-count` CLI argument counts termination signals received by each worker process. Additional signals sent only to the main process are not forwarded after shutdown begins.
153
153
:::
154
154
155
155
@@ -172,7 +172,7 @@ The number of signals before a hard kill can be configured with the `--hardkill-
172
172
*`--max-fails` - Maximum number of child process exits.
173
173
*`--shutdown-timeout` - maximum amount of time for graceful broker's shutdown in seconds (default 5).
174
174
*`--wait-tasks-timeout` - graceful completion period for current tasks during shutdown. Cancellation is requested for callbacks still running after the period, and their cleanup is awaited. The default `None` waits without a timeout.
175
-
*`--hardkill-count` - Number of termination signals to the main process before performing a hardkill.
175
+
*`--hardkill-count` - per-worker termination-signal threshold for the worker's hard-kill handling.
0 commit comments