Skip to content

fix(cleanup): exit 0 and always clear busy under the runner's bash -e - #36

Merged
azlekov merged 1 commit into
mainfrom
fix/cleanup-bash-e
Oct 19, 2026
Merged

azlekov merged 1 commit into
mainfrom
fix/cleanup-bash-e

Conversation

@azlekov

@azlekov azlekov commented Oct 19, 2026

Copy link
Copy Markdown

Follow-up to #35, which fixed only the JOB_STARTED hook. This commit was pushed to that branch after it had been squash-merged, so it never reached main.

What breaks. The runner runs the JOB_COMPLETED hook under bash -e too. On a runner with no ~/.gradle/caches (every control runner, and any runner that never ran Gradle), find exits 1. That has three effects:

Since the slots release (#31) this failed jobs on control and regular runners: smart-irrigation, nis-suite, kodni-mobile, infrasensing-senslogging.

Fix.

  • busy is cleared first.
  • Every command ends in || true.
  • The main path is cleanup || true.

Test. tests/cleanup.sh runs the hook under bash -e with and without a Gradle cache. It stubs clean_tmp, so the test machine's /tmp is left alone. It fails on the old hook (4 checks) and passes on the new one. The full suite and shellcheck -x are clean.

🤖 Generated with Claude Code

The runner runs the JOB_COMPLETED hook under bash -e too. On a runner that never
ran Gradle, `find ~/.gradle/caches` exits 1, the hook aborts, "Complete runner"
fails the job, and `busy` is left behind, so every later job takes the
crash-recovery path. Clear busy first, end every command in `|| true` and call
the main path as `cleanup || true`. tests/cleanup.sh runs the hook under bash -e
with and without a Gradle cache; it fails on the old hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@azlekov
azlekov merged commit 186d455 into main Oct 19, 2026
11 checks passed
@azlekov
azlekov deleted the fix/cleanup-bash-e branch October 19, 2026 20:57
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.

1 participant