Repository navigation
fix(builder): abandon the load operation when a resource load times out - #1553
joaodinissf wants to merge 1 commit into
Conversation
formal/README.md describes the method, target status, models and how to reproduce. formal/BUGS.md catalogues 51 findings (49 confirmed, 1 plausible, 1 refuted) plus 9 observations, all verified by three independent skeptics, with traces, test status, fix plans, a proposed fix-PR sequence and links to the fix PRs opened so far (#1550, #1551, #1552, #1553). REPORT.md is the chronological log of rounds 1-2. The patches are reference fixes used to show each disabled test turns green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| if (result != null) { | ||
| toProcess--; | ||
| consecutiveTimeouts = 0; | ||
| } else if (++consecutiveTimeouts >= MAX_CONSECUTIVE_TIMEOUTS) { |
There was a problem hiding this comment.
I do not get the point of this PR, could we not just increase the timeout if we want to try longer?
There was a problem hiding this comment.
The goal isn't to wait longer, it's what happens once a timeout fires. On master the build carries on and silently drops a different, healthy resource from the index: the timed-out wait still counts as a delivered result, so the loop ends one short. Nothing is logged for the resource that went missing, and the index stays incomplete until the next full build. With this change a timeout (or an interrupted wait) cancels the build instead, so the next one is a full build on a consistent index. This is already how the linking phase handles it on master. A longer timeout would only make the silent case rarer.
Posted by Claude Code on behalf of @joaodinissf.
4282d4c to
95ccf71
Compare
formal/README.md describes the method, target status, models and how to reproduce. formal/BUGS.md catalogues 51 findings (49 confirmed, 1 plausible, 1 refuted) plus 9 observations, all verified by three independent skeptics, with traces, test status, fix plans, a proposed fix-PR sequence and links to the fix PRs opened so far (#1550, #1551, #1552, #1553). REPORT.md is the chronological log of rounds 1-2. The patches are reference fixes used to show each disabled test turns green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ParallelLoadOperation.next() decremented the outstanding-result counter even when poll() timed out. From then on the counter was one short of the results still coming, so the builder either aborted the cluster as if it had been cancelled or, in writeResources, left some other resource silently unindexed. A longer timeout makes this rarer but cannot prevent it. Decrement only when a result is delivered. A timeout cannot be attributed to a URI, and a load that never finishes would otherwise keep the builder waiting forever, so a timeout now cancels the whole operation and says so. An interrupted wait is handled the same way: it delivers no result either, and without a result nothing would ever count it off. writeResources treats that like the linking phase already did on master: it cancels the build instead of dropping the remaining resources, so the next build is a full build rather than one with a stale index. The check is a public predicate, isAbandonedByTimeout, so that it can be tested. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
95ccf71 to
75b16e8
Compare
Why the change
A resource load timeout currently leaves the build running with an incomplete index: a different, healthy resource is silently not indexed. With this change the timeout fails the build visibly instead, and the next build is a full build. It does not change how long the builder waits.
Special things to note
Change outline
The owed-result counter in
ParallelLoadOperation.next():What the builder does after a timeout:
Tests (
ParallelResourceLoaderTest, each run against an unbounded queue and production's synchronous hand-off):timeoutAbandonsEveryOutstandingLoad: one timeout ends the operation and queued loads never start. Fails on master.interruptedWaitAbandonsEveryOutstandingLoad: an interrupted wait ends the operation too and keeps the interrupt flag. Fails on master.failedLoadDoesNotAbandonTheOperation: an ordinary load failure keeps the other loads.resultWithinTimeoutIsDelivered: sanity check.BuilderLoadTimeoutTest: only a timeout with nothing left to load counts as abandonment; a timeout with loads left, an ordinary load failure and other wrapped exceptions do not.🤖 Generated with Claude Code