Repository navigation
Make session saves atomic and recover Windows sharing conflicts - #158
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This branch was successfully deployed
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.
Rapid or overlapping SessionManager saves could share the same temporary filename and fail at os.replace on Windows. A reader holding the destination can also make Windows return access denied even though the conflict is temporary. This change makes session/index replacement atomic and serializes store operations without treating every permission error as retryable.
Independent of the ACP stack, based on current main de6b141. Addresses the storage blocker observed while validating #155.
Changes
Validation
Limits
Locks coordinate managers within one process; cross-process revision merging is not provided. Each file is atomic, but session and index are separate writes. A crash or failed index write may leave the index behind the session, for the existing stale-index recovery path to rebuild. The code does not chmod destinations or delete them to bypass permission errors.
No merge, deployment, or running-runtime replacement.
Integration revision
Final head:
c347531295e20a6ea84614ce07ae7a602559298aonfix/session-atomic-save. It includes the base fix4748531910a3cbead75f16769c9259afadb7f3e1and a follow-up for sharing conflicts that clear before the diagnostic probe. The concurrent reader test uses Windows delete-sharing handles to test atomic contents independently of intentional sharing blockers; the held-reader and real read-only-denial regressions remain.All four new storage CI jobs (Windows/Linux, Python 3.11/3.12) pass. The final code also passes all 85 ACP integration tests on the isolated snapshot.
SessionManager.save_session(session=None) -> boolis unchanged; no ACP source files were modified.All CI jobs for head
3d2eb2016e47defcea4e1ddc7be89d58595844d4completed successfully, including both Windows and both Linux storage jobs and the existing runtime/provider, TUI, documentation, and dependency-security jobs. The external CodeRabbit review was skipped by its service.Test accounting follow-up
Commit
c347531295e20a6ea84614ce07ae7a602559298acorrects the concurrency regression to assert unique temporary-file creation, not unique source paths per replacement attempt. A deterministic injected sharing conflict proves a retry reuses its original temporary file, with at most six attempts per write. All concurrency, JSON integrity, index consistency, and cleanup checks remain. This commit changes tests only. Local revalidation: 31 Windows tests passed; 29 Linux tests passed with 2 Windows-only skips. All CI jobs also passed at this new head, including Windows/Linux Python 3.11/3.12 storage contracts.