Repository navigation
engine: never fail the start over the cache entries the image ships - #15199
Merged
Merged
Conversation
An engine image's entries keep the expiry their cache gave them when the image was built. A module function's result gets the function's default lifetime of a week, and the Go module entries v1.0.0-beta.26 and v1.0.0-beta.27 ship hold one such result, the go-includes helper. A week after each image was built, every start of it fails with "root N did not merge (expired true, retained false)". The new case ships two entries, one with an expiry that has passed, and expects the start to go on with the unexpired entry merged and the expired one left out. It fails on the engine as it is. Signed-off-by: Erik Sipsma <[email protected]>
An entry an engine image ships keeps the expiry its cache gave it when the image was built, and the image outlives it: v1.0.0-beta.26 and v1.0.0-beta.27 ship the go-includes helper with a module function's default lifetime of a week, and stopped starting a week after their builds, fresh or restarted alike. An expired root is a cache miss, not a broken image. The merge already leaves an expired root out, with whatever only it needed; the engine now counts it in its log and starts. A root that is unexpired and not retained, a stale held row or a missing blob still fails the start. Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
The entries an engine image ships only spare the engine work it can do itself, yet anything that kept them from merging failed the start: an unreadable bundle, a blob the image doesn't hold, a failed merge, stale held rows or a root merged without the image's retention. Now the start never depends on them. Whatever keeps them from merging is logged, and the engine starts without them, or with the part that merged. A bundle that can't be read or names a missing blob still merges nothing, so no entry reads a part the image doesn't hold, and a merge that fails before its commit changes nothing. Signed-off-by: Erik Sipsma <[email protected]>
The publish check runs release publish on the engine the Publish workflow uses, the released v1.0.0-beta.27 image, started fresh. That engine refuses to start once an entry its image ships has expired, as one did on Nov 17, so the check failed on every pull request before running anything. The check now mounts an empty directory over the image's entries, and the engine starts without them. Signed-off-by: Erik Sipsma <[email protected]>
4 tasks done
vito
approved these changes
Nov 17, 2026
This was referenced Nov 18, 2026
This was referenced Nov 19, 2026
This was referenced Nov 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.
Every fresh start or restart of a v1.0.0-beta.26 or v1.0.0-beta.27 engine now fails:
(root 4895 on amd64). beta.26 stopped starting on Nov 16 at 20:46 PT, and beta.27 on Nov 17 at 11:44 PT. An engine that was already running keeps working until it restarts.
Why
Since #15080, an engine image ships ready-made cache entries for Go modules, which the engine merges at every start, and the start failed unless the bundle merged whole. Each entry keeps the expiry its cache gave it when the image was built. In both released images exactly one root has one: the
go-includeshelper binary. A module function returned it, so it got a module function's default lifetime of one week (MaxFunctionCacheTTLSeconds). A week after each image was built, the merge reported that root expired, and the engine refused to start.The change
The image's entries only spare the engine work it can do itself, so the start no longer depends on them at all:
TestMergeImageEntrieschecks what the start leaves in the cache:The
release/publish-with-mock-endpointscheck runs release publish on the engine the Publish workflow uses, the released beta.27 image, started fresh, so it failed on every pull request. It now mounts an empty directory over that engine's/usr/local/share/dagger/entries, and the engine starts without its entries.What it doesn't do
/usr/local/share/dagger/entriesstarts, without the pre-warmed Go module entries.go-includesentry is still left out, so a fresh engine's first Go module call builds it again, which takes a few seconds. Shipping entries without an expiry would keep it warm; that is a separate change.