Skip to content

fix(benchmarks): reap detached runners when interrupted - #240

Open
OUAO-FRANK wants to merge 1 commit into
google-research:mainfrom
OUAO-FRANK:codex/issue-239-interrupted-runners
Open

OUAO-FRANK wants to merge 1 commit into
google-research:mainfrom
OUAO-FRANK:codex/issue-239-interrupted-runners

Conversation

@OUAO-FRANK

Copy link
Copy Markdown
Contributor

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.
  • Real SIGINT/runner/descendant regressions reproduce both adapter failures on the original implementation. Mutation restores both failures; after restoring the fix, three focused runs pass.
  • Normal exit, non-zero exit and timeout controls pass.
  • ruff check harness2 tests; changed-file ruff format --check (Ruff 0.16.9); python3 -m compileall -q harness2 tests; git diff --check: pass.
  • Combined with the separate selector-choice fix: all 75 tests pass.
  • Independent local code review found no production blockers; its two test-race suggestions were applied and verified again.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Interrupted benchmark waits leave detached runners alive

1 participant