Repository navigation
Do not hang job-level instrumentation in only_job mode - #4858
Merged
Merged
Conversation
The only_job daemon was started as a background child of the init script, so the bare waits in the same script waited for its endless loop forever and the pre step never finished. Start it from a subshell so it is not a child of the script's shell. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WAy2NdEwyteCeJENENbBnE
plengauer
marked this pull request as ready for review
December 4, 2026 08:16
plengauer
enabled auto-merge (squash)
December 4, 2026 08:16
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Max errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|---|
| ✅ BASH | shellcheck | 1 | 0 | 0 | 3.23s | ||
| shfmt | 1 | 1 | 0 | 0.01s | |||
| ✅ COPYPASTE | jscpd | yes | no | no | 0.92s | ||
| ✅ REPOSITORY | betterleaks | yes | no | no | 7.06s | ||
| ✅ REPOSITORY | checkov | yes | no | no | 10.64s | ||
| ✅ REPOSITORY | dustilock | yes | no | no | 5.58s | ||
| ✅ REPOSITORY | git_diff | yes | no | no | 0.18s | ||
| grype | yes | no | 1 | 90.65s | |||
| ✅ REPOSITORY | kingfisher | yes | no | no | 7.32s | ||
| ✅ REPOSITORY | osv-scanner | yes | no | no | 14.33s | ||
| ✅ REPOSITORY | secretlint | yes | no | no | 2.03s | ||
| ✅ REPOSITORY | syft | yes | no | no | 3.25s | ||
| ✅ REPOSITORY | trivy | yes | no | no | 8.92s | ||
| ✅ REPOSITORY | trivy-sbom | yes | no | no | 0.37s | ||
| ✅ REPOSITORY | trufflehog | yes | no | no | 3.64s |
Detailed Issues
⚠️ REPOSITORY / grype - 1 warning
warning: A medium vulnerability in github-action package: anthropics/claude-code-action, version v1 was found at: /.github/workflows/claude.yml
warning: 1 warnings emitted
⚠️ BASH / shfmt - 1 error
diff actions/instrument/job/inject_and_init.sh.orig actions/instrument/job/inject_and_init.sh
--- actions/instrument/job/inject_and_init.sh.orig
+++ actions/instrument/job/inject_and_init.sh
@@ -18,7 +18,7 @@
}
export -f only_job_run
# shellcheck disable=SC2016 # the expressions are expanded by the inner shell
- ( nohup setsid bash -c 'echo "only_job_pid=$$" >>"$GITHUB_STATE"; trap "only_job_run &>/tmp/opentelemetry_shell.github.only_job.log; echo \$? >/tmp/opentelemetry_shell.github.only_job.exit_code; exit 0" SIGUSR1; while true; do sleep 1; done' &>/dev/null & )
+ (nohup setsid bash -c 'echo "only_job_pid=$$" >>"$GITHUB_STATE"; trap "only_job_run &>/tmp/opentelemetry_shell.github.only_job.log; echo \$? >/tmp/opentelemetry_shell.github.only_job.exit_code; exit 0" SIGUSR1; while true; do sleep 1; done' &>/dev/null &)
fi
if [ "${ASYNC_INIT:-FALSE}" = TRUE ]; then
See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

Show us your support by starring ⭐ the repository
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
Job-level instrumentation hangs forever in its pre step when
only_job: trueis set (introduced in #4830). Observed in autopuppeteer, dafuq and bash-ai: thePre Run …/instrument/job@bd10fab…step staysin_progressfor hours (5 runs cancelled after 4–6 h), while the same version withonly_job: falsefinishes the pre step in ~20 s.Root cause
inject_and_init.shstarts theonly_jobdaemon (nohup setsid bash -c '… while true; do sleep 1; done' &) as a background child of the script's shell. The script has barewaitcalls (before "Resolve Trace Context", inside the trace context loop, and in "Waiting for background init jobs"), and a barewaitwaits for all children, so it blocks on the daemon's endless loop.Fix
Launch the daemon from a subshell,
( nohup setsid bash -c '…' &>/dev/null & ), so it is not a child of the script's shell and the barewaits ignore it.shutdown.shfinds it viaonly_job_pidinGITHUB_STATE, so nothing else changes.Verification
bash -npasses.waithangs until killed bytimeout; with the subshell formwaitreturns immediately.only_jobon/off comparison and the reproduction.No
VERSIONbump included; the affected repos pinbd10fab # v5.68.0and need a release containing this fix.Generated by Claude Code