Conversation
…ard-killed
cpan_random_tester.pl wrapped each `jcpan -t` invocation with a plain
`timeout ${secs}s ...`, which only sends SIGTERM. A wedged JVM that
ignores SIGTERM (or a child process that has been suspended via
SIGTSTP) survives the timeout and lingers indefinitely, eating RAM
and blocking reruns.
Mirror the fix already in perl_test_runner.pl:
- Add `-k 10s` so the wrapper follows up SIGTERM with SIGKILL after a
10-second grace period.
- Treat exit codes 124 (SIGTERM-then-exit), 137 (SIGKILL) and 143
(SIGTERM) as timeouts instead of just 124.
- Skip external-`timeout` detection on Windows (`$^O eq 'MSWin32'`),
because Windows' `timeout.exe` is a sleep-with-countdown, not GNU
coreutils. Falls through to the existing fork+alarm fallback.
Cross-platform behavior:
- Linux: uses `timeout -k 10s ${secs}s` (GNU coreutils).
- macOS: uses `timeout -k 10s` if coreutils is installed via Homebrew,
otherwise `gtimeout -k 10s`. If neither, falls back to
fork+setpgrp+kill(-pid).
- Windows: skips external timeout, uses the alarm-based fallback.
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Modules tested: 4147 (+8). Pass: 1062 (+1). Fail: 3085 (+7). Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
c320cf0 to
c4889bc
Compare
2 tasks
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.
Summary
The CPAN random tester (
dev/tools/cpan_random_tester.pl) wrapped eachjcpan -tinvocation with a plaintimeout ${secs}s ..., which only sends SIGTERM. A wedged JVM that ignores SIGTERM — or a child suspended via SIGTSTP — survives the timeout and lingers indefinitely, eating ~2GB of RAM and blocking reruns.This PR mirrors the fix already merged into
perl_test_runner.pl(#567):-k 10sso the wrapper follows up SIGTERM with SIGKILL after a 10-second grace period.timeoutdetection on Windows ($^O eq 'MSWin32'), since Windows'timeout.exeis a sleep-with-countdown, not GNU coreutils. Falls through to the existing fork+alarm fallback.Cross-platform behavior:
timeout -k 10s ${secs}s(GNU coreutils).timeout -k 10sif coreutils is installed via Homebrew, elsegtimeout -k 10s. If neither, falls back tofork + setpgrp + kill(-pid).timeout, uses the alarm-based fallback.Also includes a refresh of
dev/cpan-reports/from the background tester (4147 modules tested, 1062 pass, 3085 fail).Test plan
perl -c dev/tools/cpan_random_tester.pl— syntax OKmakepasses (all unit tests green)Generated with Devin