Repository navigation
fix: Orchestrator - Let a launcher bound how long a log upload may block the loop - #417
Open
yuechao-qin wants to merge 1 commit into
Open
yuechao-qin wants to merge 1 commit into
yuechao-qin wants to merge 1 commit into
Conversation
yuechao-qin
force-pushed
the
bound-log-upload-retries
branch
2 times, most recently
from
October 30, 2026 05:23
d59f043 to
c1ff231
Compare
…ock the loop The orchestrator loop is single-threaded, so the wall time of one failing log upload delays every other container execution waiting to be processed. `_retry` gave every call five attempts a second apart with no bound on the total, and a log read that cannot succeed spent ~30s of the loop before raising. `_retry` takes `max_total_seconds` and stops once the next attempt would start past the deadline, and no longer sleeps after the final failed attempt. The three retry knobs then become class attributes on `LaunchedContainer`, because how long a log read is worth waiting for is a property of the platform, not of the loop: reading from a local informer cache and reading over a WAN are not the same bet. `None` keeps today's behaviour, so every launcher that does not opt in is unchanged. Both Kubernetes launchers set one attempt and a 10s ceiling through shared constants, so the Job and Pod paths cannot drift apart.
yuechao-qin
force-pushed
the
bound-log-upload-retries
branch
from
October 30, 2026 11:18
c1ff231 to
4fed669
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The orchestrator loop is single-threaded, so the wall time of one failing log upload delays every
other container execution waiting to be processed.
_retrygave every call 5 attempts a secondapart with no bound on the total, so a log read that cannot succeed spent ~30s of the loop
before raising.
Two changes:
_retrylearns a deadline, and the launcher — not the loop — decides what thedeadline is.
None)How
The deadline is checked before sleeping, not before attempting, so the final attempt can still
overrun by one request timeout. Bounding that too would mean threading a timeout into
func,which is the callee's concern, not the retry helper's.
The three knobs then become class attributes on
LaunchedContainer:How long a log read is worth waiting for is a property of the platform: reading from a local
informer cache and reading over a WAN are not the same bet. They sit on the launched container
rather than the launcher because a deployment may route through a launcher-router, in which case
the loop never holds the concrete launcher. Precedent:
LauncherError.is_retriable.The cost, measured
Measured on one deployment over 72 hours: 323 failing log uploads produced 1723 attempt log lines
—
1723 / 323 = 5.33, the five attempts — each costing the single loop thread a second of sleepbetween tries. Queries and raw figures are in
Shopify/oasis-backend#827, an internal
repository.
A log upload that fails now raises sooner rather than differently; what makes a lost log stop
raising at all is the companion change, #418.
Verification
pytest --ignore=tests/instrumentation -q→ 445 passed. 15 tests cover the deadline, the threeknobs, and the real Job and Container classes driven through the orchestrator's helper; removing
either launcher's budget turns exactly that launcher's parametrised case red.