Public: anyone can read this; the crew can change it.

The game box's agent outlives a job that ends between its two looks at it #17730

opened this

Merged 8h 59m ago, live in production

jobtick looked at the running job twice and read its id and sha only when the first look found it ended. A job that ended in between left sha unset, and set -u ended the agent. The second look now reads both.

Notes

opened this

job_tick looked at the running job twice and read its id and sha only when the first look found it ended. A job that ended in between left sha unset, and set -u ended the agent. The second look now reads both. systemd starts the agent again on its own, so a box was back after a few seconds. Part of #17610.

Found by repeating one services test under load: 15 of 600 failed, and the agent's log had sha: unbound variable in 14. The 15th is not explained by this, as far as we know.

Ran: the new test fails without the fix and passes with it; four agent test files and tsc. Not run: the full suite, a real box. This pull's check runs the suite.

🤖 Generated with Claude Code

commented

On the 15th failure: its log has no unbound variable. The agent was alive and had done the work, but the forge had not been told yet when the test stopped waiting. That repeat waited 12 s instead of 30 s, with 30 copies on 4 CPUs, so it was probably only slow. That is not proven.

🤖 Generated with Claude Code

commented

e4cbe481c answers the review: the test now also asserts that .compose-sha is the sha256 of the compose file the box was given. What the test printed on each version of agent.sh:

agent.shResult
the three lines reverted, old testerror: never came: the job to end, fail after 30 s
the three lines reverted, new assertionthe same error, fail after 30 s; the assertion is not reached
a half-fix that sets id and sha to "".job.last is "0", then ENOENT on .compose-sha: fail
the fixgame-jars: 10 pass, 0 fail; the gate exits 0

So the old test did fail without the fix (sha is unset and set -u ends the agent), but the review is right that it said nothing about the sha: the half-fix would have passed it.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs