Repository navigation
[backport-0.21] engine: prune DAGQL cache by metadata size - #13886
Merged
Merged
Conversation
Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit 615a02d)
Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit b087da9)
Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit fa45dbd)
Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit 0a46329)
Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit d114c9a)
Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit d801635)
Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit 27fc2b5)
Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit dc1e998)
Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit 348fbe2)
Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit 4573145)
Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit 73687bb)
Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit 49c3302)
Lower the class-slot coefficient to 768 bytes after the required 200k churn benchmark measured the 1024-byte hypothesis at a 2.199 estimate-to-post-GC-heap ratio. The calibrated coefficient measures 1.649 while preserving the approved structural formula and keeping a common one-million-entry graph above the 4 GiB trigger. Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit c81de1c)
Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit ca83937)
Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit d032d00)
Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit 686e238)
Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit 938cc52)
Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit 3b5780b)
Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit 06c452b)
Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit b19467f)
Signed-off-by: Erik Sipsma <[email protected]>
grouville
self-requested a review
August 12, 2026 22:46
grouville
approved these changes
Aug 12, 2026
sipsma
force-pushed
the
backport-13846-0.21
branch
from
August 13, 2026 02:19
f951484 to
e6b8f7c
Compare
GitLab automatically revokes user PATs when it detects that they were leaked. That is what these private repository tests used, and both tokens were revoked. GitLab does not document the same automatic response for project deploy tokens. Replace the PATs with read-only deploy tokens scoped to the test project. Deploy tokens use a username and token pair, so pass the matching username through each Git authentication path. These credentials are intentionally committed for end-to-end tests. They can only read one disposable test repository, which contains no private code or data, so exposing them does not grant access beyond the test fixture. Keep both credentials in the shared VCS fixture so future rotations happen in one place. The second token is still needed to test two different credentials for the same repository. Signed-off-by: Guillaume de Rouville <[email protected]> (cherry picked from commit 66337ba) Signed-off-by: Erik Sipsma <[email protected]>
sipsma
force-pushed
the
backport-13846-0.21
branch
from
August 13, 2026 02:38
e6b8f7c to
89af130
Compare
sipsma
marked this pull request as ready for review
August 13, 2026 02:57
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
Backports the complete metadata-aware DagQL cache-pruning behavior from #13846 to v0.21:
3072*results + 512*terms + 768*class slots)gc.dagqlCache.maxEstimatedBytes/targetEstimatedBytes, thedagger_dagql_cache_metadata_estimated_bytesmetric, bounded aggregate observability, tests, scale benchmarks, docs, and a v0.21.9 change entryThis bounds retained metadata growth and may mitigate scale-related symptoms. It does not claim to directly fix the reported
egraphMu/ startup contention.The separate bounded manual structural-prune API discussed with Erik is intentionally not included because it was not part of #13846. The source defaults remain unchanged at 4 GiB maximum / 3 GiB target.
Source PR and commits
615a02dbdaf6ef107f8a1dfa3c45d39624403645^..b19467f2b032bb4c000c5c80bbe21ac062ac03f5(20 commits; parentba839a98077aef4398415ccc805f57fd694c2e4b)f021d54d4c0824061690fa4669fc39d39183d4d1^..0371e77ae8210df2f7583e2fa0ac39b08019f32f, followed by v0.21 adaptation commit5479f384e8bff0e2d87d981838528adbe755ef2cdeploy tokensfor GitLab #13849; source PR commit0c656b9ca6395fdec1f051d34987bb4f8864196a; merged main commit66337ba5d3d01ae10a0d7fb97ebe4dec9326e8bcbecaa3a33542ccc7e96dbf3f430d887f41958e52, validated on [backport-0.21] fix: hide registry HTTP probe errors #13885 and initially cherry-picked unchanged asf951484dde70cd431a5e19f84027aa4eaa946367; after two byte-identical CI head refreshes, the current equivalent tip is89af13099acc7a46885023b096b25372e32931f4(tree631aa606fb061a4464f838559c2569c25bb9eb9b)All 20 metadata-pruning source commits, including the design-review history, are preserved in order with
cherry-pick -x; none were squashed or omitted. The additional v0.21 adaptation and fixture-propagation commits are also DCO-signed. The fixture commit preserves Guillaume de Rouville as author and the source traceability footer.Prerequisite
#13375's GC pressure-monitor machinery is already present on
backport-0.21as78fc50e58a4f417825e414463829c1bc7c2053d2. Its stable patch ID matches source commit838b7c73ab69fb5bc97cfa1139478ae7d305e4ed, so this backport relies on the existing v0.21 implementation rather than duplicating it.v0.21 adaptations
stateMugraceful-stop/session lifecycle and namespace-worker initialization while applying the new scheduler/config state. Main-onlycore.SetWorkspaceInvalidator, recursive-read-only-mount context, and a session-test field rename are absent from v0.21 and were not pulled in as unrelated changes.skills/cache-expert/references/.dagger api with-sessionspelling to the equivalent v0.21dagger runcommand.Author: sipsma,PR: 13846.Validation run
./dagql: 295 tests passed — pruning semantics, trigger/target correction, active/unpruneable protection, no-detail structural mode, compaction, persistence/restart, and estimator accounting. trace./engine/server: 61 tests passed — defaults/config resolution, no-disk-stat behavior, lifecycle scheduling, pressure monitoring, blocked/no-progress recovery, explicit/session reset behavior. trace./engine/config: compiled successfully (no package tests). trace./cmd/engine: 7 tests passed. traceTestEngine/TestPrometheusMetrics: 2 tests passed and observed the new metadata gauge. traceTestLocalCache/TestDagqlMetadataGCProtectsActiveZeroDiskResults: 2 tests passed; the workload remained active through a pressure-monitor interval, produced metadata growth with only 4 KiB disk use, stayed protected while active, then closed and was structurally pruned. traceHeapInuse; 1M metadata pruning removed all roots in ~14.7 s with ~893.8 MB peak scratch. tracecheck-tidypassed. trace5479f384e8bff0e2d87d981838528adbe755ef2cpassed DCO and 69 Dagger Cloud contexts; five split suites failed only where GitLab rejected the revoked private-fixture PAT. base trace, call/shell trace, CLI/engine trace, container trace, modules trace.becaa3a33542ccc7e96dbf3f430d887f41958e52: all 75 applicable checks passed, including all five formerly failing shards andTestPrivateGitRepoArgCachingin real CI.c5ece8f8d50919d36bdb6abad1e312d65ae8a2bf), changed only the same six integration-test files (35 additions, 30 deletions), and passedgit diff --check. Final head89af13099acc7a46885023b096b25372e32931f4passed all 75 applicable statuses (74 Dagger Cloud contexts plus DCO). Initial failures were trace-classified rather than dismissed: Linux/arm64 Wolfi release exited 139 (failed trace, final pass); telemetry saw a runtime-only13.6% droppedgolden suffix (failed trace, final pass); and one 441/442 module-runtime run failed during pinned Python 3.13.1 initialization (failed trace, final pass).dagger cloud reruncould not resolve the cross-fork PR or synthetic merge SHA from this runner, so the two retries used committer-timestamp-only tip refreshes, byte-identical tree checks, and explicit--force-with-lease.backport-0.21advanced from9f68624bf69c23c01861e298651656ecac780285to269c47d7708b4623c3fbfdcd2440d19a055dc7e0via [backport-0.21] fix: hide registry HTTP probe errors #13885, which independently absorbed the same six-file fixture patch (stable patch IDc5ece8f8d50919d36bdb6abad1e312d65ae8a2bf) alongside its registry-observability fix. Final green synthetic merge86bdee550d36867afd02cfdd8d44b08ccebaae79has exact parents base269c47d7708b4623c3fbfdcd2440d19a055dc7e0and head89af13099acc7a46885023b096b25372e32931f4; the retained traceable head commit merges without conflict or behavioral duplication. Upstream squash commit49559d42c9c9dc2588dc53f834e15ea572f69ae7has the identical tree3821ccc63bdbed5ee821980aa6893b9eea7044be.check-for-changelogjob was intentionally skipped because the PR has noneeds/changeloglabel; the release entry is present and Dagger Cloud'schangelog:generatecheck passed.gofmt-clean;git diff --checkpassed; all 22 commits have DCO signoff; gc: prune local cache during disk pressure #13375 prerequisite patch IDs and all 20-xsource footers were audited.Release note
Adds
.changes/unreleased/Fixed-20260812-213129.yamlfor v0.21.9, attributed to source PR #13846. The GitLab fixture propagation is test-only and adds no separate release entry.Risk and remaining work
This was published and fully validated as a draft because it is a large engine/cache backport. GitHub records
sipsmaas squash-merging it at2026-08-13T02:58:09Z, after the final green run. The revoked GitLab fixture credential was addressed by propagating the exact six-file v0.21 patch proven on #13885, and the final combined-head matrix has converged green. The complete integration suite beyond the published split coverage remains unrun.The root full-lint command was attempted but is currently blocked by unrelated generated docs snippets (
default-address/go) that cannot import their generated internal package. Targetedgo vetwas also attempted; it reports pre-existing context-cancel findings indagql/cache.go(blamed toaa719a10d52, before this series) andengine/server/session_attachables.go(74c2889afc6, untouched here). Those unrelated findings were not changed to keep this backport scoped.The estimator is deliberately coarse and structural rather than RSS-based. A pre-existing oversized schema-16 graph is fully imported before the one-second startup prune, so a temporary upgrade/startup memory peak remains possible. This patch bounds retained metadata after pruning; it does not establish a direct fix for lock contention.