Repository navigation
Conversation
Signed-off-by: Dezhen Lu <dezhen.lu@student.uni-tuebingen.de>
Wait for each group leader without reaping it until all owned groups have been stopped, so a previously exited leader cannot leave its workers behind or have its process-group ID reused during cleanup. Also defer default termination signals while registering children and stopping and reaping those groups. On normal completion, stop any remaining workers before reaping leaders. Require the default SIGCHLD disposition so children are not auto-reaped. Test Plan: CPU-only pytest runner/concurrent selection (28 passed); all applicable pre-commit hooks passed using the cached offline environments. Signed-off-by: Dezhen Lu <dezhen.lu@student.uni-tuebingen.de>
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.
Fixes #12624.
When the second concurrent test process cannot start,
_concurrentcurrently leaves the first running. Similarly, an exception while waiting can leave other pytest processes alive. Start each command in its own session, and on an exception kill its still-owned process group and reap each started process before propagating the error. This also reaches pytest workers in the group.On the main thread, temporarily handle default SIGTERM and SIGHUP so those signals take the same cleanup path; restore the previous handlers afterward. Existing custom or ignored signal handlers are left alone. SIGKILL and processes that deliberately leave their group cannot be handled by this mechanism. This change is separate from #12360, which fixes aggregation of negative child exit statuses.
Testing
pytest -s --tb=short python/test/unit/runtime/test_driver.py -k 'runner or concurrent': 18 passed (CPU;CUDA_VISIBLE_DEVICESempty). The new cases cover partial startup with a real child and grandchild, a wait exception, the normal success path, and SIGTERM delivered to the runner.pre-commit run --from-ref origin/main --to-ref HEAD: passed.Tests used the current Python source with an existing Triton 3.9 native extension built from an earlier commit; no compiler rebuild or GPU execution was needed for this Python-only change.
New contributor declaration
pre-commit run --from-ref origin/main --to-ref HEAD.python/test/.littests.