Skip to content

cloud: the quota halt is flagged on the worker, not the main thread - #20

Merged
weiwchu merged 2 commits into
mainfrom
cloud-quota-halt
Oct 12, 2026
Merged

weiwchu merged 2 commits into
mainfrom
cloud-quota-halt

Conversation

@weiwchu

@weiwchu weiwchu commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

The ci run on the #17 merge (171948d) failed in the test job on test_an_exhausted_quota_stops_the_cell_instead_of_bleeding, four calls past the quota wall where two were allowed. The PR run minutes earlier had passed, and the #18 merge run passed again.

It is a race in align_corpus. The worker thread raised the quota error, but only the main thread set halt, after it woke from as_completed, and by then the worker had started its next items. On an idle machine that is one or two items, on a loaded runner it was four. Reproduced here one time in fifteen with the test pinned to a CPU shared with two busy loops.

The worker now flags the halt as it raises, so its next item sees it before any call leaves, and the test asserts exactly one call. Fifteen of fifteen pass under the same contention, the cloud test file passes, lint passes. One line under Unreleased, Fixed, in the CHANGELOG. No published number changes.

Stacked on #19, so until #19 merges this PR also shows its README link commit.

The badge now goes to https://olewave.com/en/leaderboard/fa-bench in
place of the records page in this repo. The records links in the README
are unchanged, and the Unreleased section of the CHANGELOG says so.
align_corpus set halt when the main thread got round to the failed
future, while the worker that raised it had already started its next
item. On a loaded CI runner that was four calls past the wall, and the
ci run on the #17 merge failed on the test for it, four calls where two
were allowed. The worker now flags the halt as it raises, so its next
item sees it before any call leaves, and the test asserts exactly one
call. Reproduced locally one time in fifteen with the test pinned to a
CPU shared with two busy loops, and fifteen of fifteen pass after.
@weiwchu
weiwchu merged commit 6c0091c into main Oct 12, 2026
4 checks passed
@weiwchu
weiwchu deleted the cloud-quota-halt branch October 12, 2026 22:35
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