Skip to content

fix(broker): a lease on several cards waits for its window with no deadline - #292

Merged
T-Crypt merged 2 commits into
nextfrom
T-Crypt/gang-window-wait
Nov 2, 2026
Merged

T-Crypt merged 2 commits into
nextfrom
T-Crypt/gang-window-wait

Conversation

@T-Crypt

@T-Crypt T-Crypt commented Nov 2, 2026

Copy link
Copy Markdown
Owner

A lease window (#290) lets a job wait for set hours. On one card, a windowed run with no --wait waits for its window with no deadline. On several cards (berth run --gpu gpu0,gpu1 --window 23:00-07:00), the same run gave up after berthd's default wait of 120 s and exited refused.

Cause

Acquire and AcquireAll each worked out the wait. Only Acquire had the rule that a window with no --wait means no deadline.

Fix

Broker.waitFor holds the rule, and both Acquire and AcquireAll call it. No other code reads DefaultWait.

Proof

  • TestWindowWaiterOnSeveralCardsOutlastsTheDefaultWait (broker): a lease on two cards with a pinned evening clock and a 50 ms default wait is still waiting after 200 ms, and it gets both cards once the clock moves inside the window.
  • TestRunOnSeveralCardsWaitsPastTheDefaultForItsWindow (runner): berth run on gpu0,gpu1 against a two-card berthd with a 200 ms default wait is still queued on both cards after 1 s.
  • Both tests fail on next without the fix. The runner test's output before the fix: refused: gave up after 200ms: outside its window 09:48-10:48; opens in 1h.
  • Full proof passes: build, gofmt, vet, go test ./..., the Windows build and vet, golangci-lint. The new tests also pass under -race -count=3.

A night job split across two cards and started in the evening gave up after
berthd's default wait, while the same job on one card waits for its hours.
One test drives AcquireAll with a pinned clock, the other runs berth run
against a two-card berthd. Both fail here.
…adline

Acquire and AcquireAll each worked out how long a request waits, and only
Acquire knew that a window with no --wait means no deadline. waitFor now
holds the rule, and both call it.
@T-Crypt
T-Crypt merged commit 2b7523f into next Nov 2, 2026
2 checks passed
@T-Crypt
T-Crypt deleted the T-Crypt/gang-window-wait branch November 2, 2026 16: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.

1 participant