Skip to content

Mark a job finished before handing the host to the next one - #95

Merged
wmantly merged 1 commit into
mainfrom
fix/finish-job-before-handing-host-on
Nov 5, 2026
Merged

wmantly merged 1 commit into
mainfrom
fix/finish-job-before-handing-host-on

Conversation

@wmantly

@wmantly wmantly commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Closes #94.

In launch's end (pkg/server/apply.go), s.opts.Jobs.Finish now runs before s.queue.release().

release hands the host straight to the next waiting job, which records its Started at once. Recording Finished afterwards let the job history show two host-changing jobs overlapping when they never ran together. That is also why TestApplyAndInstancesShareTheHostAndABusyApplyKeepsItsApproval failed now and then. The host is still held until release, so marking the job finished first is always true.

Checks:

  • go test -race -count=60 -run TestApplyAndInstancesShareTheHostAndABusyApplyKeepsItsApproval ./pkg/server/: 60 out of 60 pass.
  • gofmt -l .: empty.
  • go vet ./...: ok.
  • go test -race ./...: all pass.
  • node --check: ok.

No self-merge.

🤖 Generated with Claude Code

end() released the host queue first and recorded Finished after. release
starts the next job in line at once, so its Started could come before
the previous job's Finished: the job history showed two host-changing
jobs overlapping when they never ran together, and
TestApplyAndInstancesShareTheHostAndABusyApplyKeepsItsApproval failed now
and then. The host is held until release, so recording Finished first is
always true.

Closes #94.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wmantly
wmantly merged commit 34d918b into main Nov 5, 2026
2 checks passed
@wmantly
wmantly deleted the fix/finish-job-before-handing-host-on branch November 5, 2026 17:04
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.

A job hands the host to the next one before it is marked finished, so job times can overlap (flaky combined_test)

1 participant