Repository navigation
perf(unpack): poll for the build artifact under a deadline - #115
Merged
Merged
Conversation
When the artifact was not on the volume at container start, maybe_unpack slept a fixed 30s before retrying, even if the artifact landed a moment later. On a measured RTX 4090 cold start this was ~32s of a ~38s in-container start. - Retry every 0.5s until a 60s deadline (same worst case as 3 x 30s) - Retry extraction errors too; a partially written tarball fails to extract - Log the wait once and the failure once, instead of an error per attempt Linear: SLS-812
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused retry change and updated tests have no identified blocking issues.
No open issues 🎉
What changed in this PR
Reduces worker startup delays when build artifacts arrive late on the mounted volume.
Changes:
- Replaces fixed retries with 0.5-second polling under a 60-second deadline.
- Consolidates retry logging.
- Adds fake-clock tests for timeout handling and prompt recovery.
| File | Description |
|---|---|
| tests/unit/test_unpack_volume.py | Tests deadline handling, late artifacts, and logging. |
| src/unpack_volume.py | Implements deadline-based polling and consolidated logging. |
| src/constants.py | Defines the retry timeout and polling interval. |
Review effort: Balanced
jhcipar
approved these changes
Oct 19, 2026
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.
Summary
When the Flash build artifact was not on the volume at container start,
maybe_unpack()slept a fixed 30s (DEFAULT_TARBALL_UNPACK_INTERVAL) before retrying, even if the artifact landed a moment later.DEFAULT_TARBALL_UNPACK_ATTEMPTSandDEFAULT_TARBALL_UNPACK_INTERVALare replaced byDEFAULT_TARBALL_UNPACK_TIMEOUTandDEFAULT_TARBALL_UNPACK_POLL_INTERVAL. Nothing else referenced the old names.Impact
Measured cold start on an RTX 4090 (SLS-811), with container start at t=0:
flash build artifact not foundAbout 32s of the ~38s in-container start was this sleep. With this change, a late artifact is picked up within 0.5s of landing.
Test plan
make quality-check: 295 passed, 78.49% coverage, 14/14 local handler testsartifact unpacked after Xs of retriesinstead of a 30s gapLinear: SLS-812 (related: SLS-811)