Repository navigation
MAINT: Coordinate scenario progress refresh per run - #3197
Merged
Richard Lundeen (richlundeen) merged 3 commits intoOct 15, 2026
Merged
Richard Lundeen (richlundeen) merged 3 commits into
Richard Lundeen (richlundeen) merged 3 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: dc840928-2e09-41f7-8d61-43c6bc42a3a7
Adrian Gavrila (adrian-gavrila)
approved these changes
Oct 14, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: dc840928-2e09-41f7-8d61-43c6bc42a3a7
Roman Lutz (romanlutz)
approved these changes
Oct 15, 2026
Preserve upstream reordered-replacement recovery and use per-run refresh ownership assertions after interruption and recovery. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: dc840928-2e09-41f7-8d61-43c6bc42a3a7
Richard Lundeen (richlundeen)
deleted the
richlundeen-async-memory-progress
branch
October 15, 2026 21: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.
Description
Replace the shared scenario-progress refresh lock with one lock per run. A slow storage read for one run no longer blocks refresh for unrelated runs. Requests for the same run remain serialized across cache validation, page hydration, and snapshot construction.
Keep lock ownership separate from replaceable cache data. Track owners and waiters so eviction, plan changes, cancellation, and storage failures cannot split a run's lock. Protect active entries from LRU eviction, allow temporary overflow only when protected entries exceed the normal 32-run limit, and trim the cache as requests finish. Remove unused lock state when the last caller exits.
Progress calculations, keyset queries, page size, REST response shapes, and queue behavior are unchanged. No background refresh tasks or new shutdown duties are added. Calculation and metrics-file optimizations remain out of scope.
This implements item 3 of the async memory backend improvements plan, after #2953 and #3046.
Tests and Documentation
Add event-gated tests for cross-run overlap, same-run serialization, owner and waiter cancellation, partial-page recovery after storage failures, protected-entry eviction, temporary overflow cleanup, snapshot failures, and plan invalidation. Review also identified missing coverage for an owner exiting while same-run callers are waiting; the new test covers both cancellation and storage failure, retains the saved cursor, and verifies that a later caller uses the same lock.
Update the read-model and helper descriptions to explain per-run ownership and the cache-overflow rule. Component responsibilities and public APIs do not change.
Validation:
Passed: 69 tests.
Passed: all hooks, including the full project type check, memory migration checks, and documentation checks.
UV_DEFAULT_INDEXwas preserved anduv.lockis unchanged.JupyText execution and the full unit suite were not run. No notebooks changed; validation used the scoped regression and statistics-parity tests above.