Repository navigation
fix(benchmarks): reap detached runners when interrupted - #240
Open
OUAO-FRANK wants to merge 1 commit into
Open
OUAO-FRANK wants to merge 1 commit into
OUAO-FRANK wants to merge 1 commit into
Conversation
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.
Problem
LAB and JobBench start benchmark runners in independent process groups. If a wait receives KeyboardInterrupt, the caller exits that wait while its runner and descendants remain alive. This is reachable in main-thread adapter calls, including LAB reference judging with
harness2-judge --bases.Change
Handle KeyboardInterrupt with the existing timeout cleanup: stop the runner group, reap the direct child, and re-raise the original exception. Normal completion, non-zero exit and timeout behavior are unchanged. No signal handlers, concurrency policy or security configuration change.
Fixes #239.
Validation
Linux / Python 3.12.3, base 6868817:
python3 -B -m unittest discover -s tests -v: 72 tests pass.ruff check harness2 tests; changed-fileruff format --check(Ruff 0.16.9);python3 -m compileall -q harness2 tests;git diff --check: pass.Scope: cleanup applies when KeyboardInterrupt reaches these waits. It does not implement whole-sweep cancellation or arrange for SIGINT to reach worker threads. Descendants deliberately leaving the process group are not covered. Validation is offline; no live provider or full benchmark run was performed.
AI assistance: OpenAI Codex was used for investigation, implementation and regression tests.