Skip to content

fix: treat incomplete image metadata as cache miss - #13346

Merged
sipsma merged 1 commit into
dagger:mainfrom
sipsma:fix-manifests-thread-202606060131
Jun 6, 2026
Merged

sipsma merged 1 commit into
dagger:mainfrom
sipsma:fix-manifests-thread-202606060131

Conversation

@sipsma

@sipsma sipsma commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Problem

PR #13341 started caching resolved registry image manifest and config metadata in the engine content store. That lets canonical config resolution and later lazy pulls reuse metadata after tag revalidation, but it also introduced a new local fast path for digest-pinned refs.

That local path could observe partially written metadata. If the root OCI index digest was present locally but the matching platform manifest or config had not been fetched or source-labeled yet, the resolver attempted to resolve the requested platform entirely from the local content store. resolveManifestDescriptor collapses failed candidate reads into no manifest matches requested platform, so incomplete local metadata became a hard platform error instead of a local cache miss and remote fallback.

This matches the flaky CI symptom where valid multi-platform image digests intermittently failed with errors claiming there was no linux/amd64 manifest.

Fix

Add a local-only manifest resolver that distinguishes:

  • complete local metadata hits
  • incomplete local metadata, treated as a cache miss
  • true platform mismatches, still returned as errors

The local config and closure fast paths now use that resolver. Remote manifest resolution keeps the existing behavior, so real remote platform mismatches are still surfaced normally.

Tests

  • go test ./engine/server/resolver -count=1

The new resolver test seeds only the root index locally while a fake registry serves the complete index, manifest, and config. The resolver must fall back to remote and return the config instead of failing with the bogus platform mismatch.

PR dagger#13341 started caching resolved image manifest and config metadata in the engine content store so later canonical config resolution and lazy pulls can avoid repeated manifest/config GETs. That introduced a new local fast path for digest-pinned refs: if the root index digest was present locally, the resolver tried to resolve the requested platform entirely from the local content store.

That local path could observe partially written metadata. For example, one resolver could have stored the root OCI index while another concurrent resolve had not yet fetched or source-labeled the matching platform manifest/config. resolveManifestDescriptor collapses failed candidate reads into "no manifest matches requested platform", so this incomplete local state became a hard platform error instead of a cache miss and remote fallback. CI then reported flaky errors saying a valid multi-platform digest had no linux/amd64 manifest.

Add a local-only manifest resolver that distinguishes complete hits, incomplete local metadata, and true platform mismatches. The local config and closure fast paths now treat incomplete metadata as a miss, while remote resolution keeps the existing behavior for real platform errors.

Cover the regression with a resolver test that seeds only the root index locally while a fake registry serves the full index, manifest, and config. The resolver must fall back to remote and return the config instead of failing with the bogus platform mismatch.

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma sipsma added this to the v0.21.5 milestone Jun 6, 2026
@grouville
grouville self-requested a review June 6, 2026 02:18
@sipsma
sipsma merged commit 5179818 into dagger:main Jun 6, 2026
76 of 77 checks passed
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
dagger 0.21.5

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## v0.21.5 - 2026-06-10

### Added

- Added expand option to container.exists by @alexcb in dagger/dagger#13310
- Support both Dang v1 and v2, routed by module engineVersion by @vito in dagger/dagger#13388

### Changed

- Prune local cache during disk pressure by @sipsma in dagger/dagger#13375
- Persist trivial core objects by @sipsma in dagger/dagger#13387

### Fixed

- Correct namespaced type-name mangling and cross-dependency interface dispatch in Dang by @vito in dagger/dagger#13377
- Surface exec errors correctly on the Bun runtime in the TypeScript SDK by @marcosnils in dagger/dagger#13395
- Ignore host xattrs for local filesync import identity by @sipsma in dagger/dagger#13389
- Don't shallow-clone the user's repo for git telemetry labels by @marcosnils in dagger/dagger#13363
- Preserve pending lazy container parents by @sipsma in dagger/dagger#13365
- Preserve withChanges parent layers by @dagger-codex[bot] + @shykes in dagger/dagger#13342
- Treat incomplete image metadata as cache miss by @sipsma in dagger/dagger#13346
- Cache registry image metadata by @dagger-codex[bot] + @shykes in dagger/dagger#13341
- Don't require id field for interface conformance in Dang by @vito in dagger/dagger#13318
- Use module-local check names for scale-out by @dagger-codex[bot] + @tiborvass in dagger/dagger#13329
- Fix snapshot owner lease attach/remove race by @sipsma in dagger/dagger#13321
- Follow source symlinks when copying directory contents in layercopy by @marcosnils in dagger/dagger#13326

### What to do next?

- Read the [documentation](https://docs.dagger.io)
- Join our [Discord server](https://discord.gg/dagger-io)
- Follow us on [Twitter](https://twitter.com/dagger_io)

</pre>
  <p>View the full release notes at <a href="https://github.com/dagger/dagger/releases/tag/v0.21.5">https://github.com/dagger/dagger/releases/tag/v0.21.5</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!11205
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.

2 participants