Repository navigation
Make the SIGKILL timeout configurable with start --timeout - #258
Open
meysam-licenseware wants to merge 1 commit into
Open
meysam-licenseware wants to merge 1 commit into
meysam-licenseware wants to merge 1 commit into
Conversation
Honcho sends SIGKILL to the remaining processes 5 seconds after the first one exits. That cuts short processes which need longer to shut down gracefully, such as a job queue worker finishing its current job (nickstenning#189). Add a kill_wait argument to Manager and a -t/--timeout option to `honcho start`, with the same name and meaning as Foreman's. The default is still 5 seconds. Closes nickstenning#189.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #189.
Honcho sends SIGKILL to the remaining processes 5 seconds after the first one exits (
KILL_WAITinhoncho/manager.py). Processes that finish in-flight work when they get SIGTERM, such as a job queue worker completing its current job, are killed part-way through whenever that takes longer than 5 seconds, and there is no way to change it.This adds Foreman's option for it.
foreman start -t, --timeoutis documented as "the amount of time (in seconds) processes have to shutdown gracefully before receiving a SIGKILL, defaults to 5".Changes
Managertakeskill_wait(defaultKILL_WAIT, still 5), andloop()uses it. The module constant stays, so existing callers are unaffected.honcho start -t N/--timeout Npasses it through. The default is unchanged.doc/using_procfiles.rstdescribes the shutdown sequence and the option;CHANGELOG.rstgets an Unreleased entry.Tests
tests/test_manager.py: a clock that advances on every read, plus a process manager that recordsterminate/kill. They check that the straggler is killed only after the wait: after 5 s by default, and after 0 s and 10 s when configured.tests/test_command.py:-t/--timeoutparse, the default matchesKILL_WAIT, andcommand_startpasses the value toManager.tests/integration/test_start.py: a process needs 1 s to finish after SIGTERM. It finishes under the default and is killed with--timeout 0. Skipped on Windows.Tests pass on every interpreter in the matrix on the fork: 142 passed on CPython 3.8–3.13 and PyPy 3.9/3.10, against 135 on unchanged
main(branch run, main run).The
lintenv fails in both runs with the same 17RUF059errors in existing tests (ret, out, err = ...with unused names). tox installs ruff unpinned, and the version it got here (0.16.8) reports that rule. This PR adds no new findings. I am happy to fix the existing ones in a separate PR, or to pin ruff, if you prefer.🤖 Generated with Claude Code