Repository navigation
fix(graph): settle disposal, bound storage, and progress buffered staging - #666
Merged
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Problem
A forced live Labby refresh stalled during private graph disposal before publication. SQLx 0.8.6 can finish pool shutdown before a connection returning through its asynchronous release path enters the idle queue. Waiting only for the connection count to become zero leaves that late idle connection undrained.
Resolution
Keep private graph reservations independently polled while ordered embedding buffers consume earlier results. A third live run exposed a gate deadlock: a suspended speculative graph completion owned the writer needed by the preceding batch checkpoint. Staging now uses an owned task with abort-on-drop cancellation.
Separate the 256 MiB logical journal/side-effect budget from the 1 GiB physical SQLite aggregate budget; canonical rows, indexes and transaction sidecars require storage overhead. A second live Labby attempt failed cleanly with the original 256 MiB physical cap while its logical journal was below 100 MiB. Sparse boundary tests cover all sidecars and byte-count diagnostics.
Repeat graceful pool shutdown until the private pool reaches zero connections, retaining the owner lock throughout. Log the original generation failure through the existing bounded, redacted diagnostic projection before disposal.
Skip bulk UPSERT updates when every mutable column is identical, preserving NULL transitions, actual changes, and creation timestamps. The serial private graph writer now has one connection and a bounded 64 MiB page cache; DELETE/FULL durability remains explicit.
Approach and reviewer considerations
The shared settlement helper covers explicit disposal and cancellation/drop. The regression blocks
after_releaseacross shutdown, then releases the connection into the closed pool. No transport changes, schema changes, configuration changes, or timeout-based unlocking.Verification
0a5d894e8passed all CI checks. Live Labby generation 26 completed without degradation in 411.463 seconds with 2,305 documents and 35,560 points; graph staging progressed concurrently and activation used bulk application. Compared with the earlier baseline, this input has 62 additional documents, so no identical-input speedup is claimed.de412c30alive Labby generation 27 completed without degradation in 349.126 seconds: 2,305 documents, 35,561 points; same 2,362 inventory paths as gen26 with one content hash changed. Phase totals: preparation/embedding/graph staging 282.080s, atomic publication 66.398s, completion 0.648s. Bulk graph activation dropped from 47.611s to 16.120s; total run dropped by 62.337s (15.15%). These are two live forced refreshes, not proof of provider-cold performance.dcbd50b8683ce2b752c2e623a4fe8a6e3b0c04ee; its tree matches tested headde412c30a. Deployedaxon:main-dcbd50b86on Tootie; readiness reports SQLite, Qdrant, and TEI ready, Docker healthy with zero restarts.Risk
Disposal retains ownership while SQLite connections remain. Physical cleanup stays asynchronous and uses durable recovery records. The original failed live generation was never published; the prior committed generation remained selected.