Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c78a9002b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| val identity = checkNotNull(ownedFiles[temp]) | ||
| journal.append(false, TorrentOwnedPath(checkpointPath.toString(), identity)) | ||
| currentCoroutineContext().ensureActive() |
There was a problem hiding this comment.
Remove the staged checkpoint when cancellation wins
If the caller is canceled while the temporary checkpoint is being written or flushed, this check throws after the full snapshot has been created and registered in ownedFiles, but no code deletes it. Retrying on the same store does not rerun initialize()'s stale-temp cleanup, so repeated canceled replacements accumulate potentially multi-megabyte .tmp files and journal entries until the entire session is cleaned up. Delete the staged file by its recorded identity and remove its in-memory ownership entry on this pre-rename cancellation path.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed by cleaning up a failed or canceled staged checkpoint inside the admitted I/O operation. Deletion requires the recorded OS identity to still match; the in-memory temporary entry is removed after cleanup. The original failure is preserved if cleanup also fails. A regression repeatedly cancels before rename on the same store, checks that no temporary files or ownership entries remain, verifies the prior committed bytes/configuration, and retries successfully. It failed before the fix.
|
Superseded by #237 (Tracker lifecycle, editing and discovery privacy) in the consolidated eight-PR stack for #162. The replacement preserves this PR's code and subsequent fixes; its description links the original head and review discussions. The only additional consolidation fix is the CI-discovered listener cancellation regression, documented on the replacement. All eight replacements have passed their required CI checks. Closing without merging. This branch and its discussions remain available for reference. Review index: #162 (comment) |
Adds a piece-store transaction for tracker configuration replacement using a flushed temporary checkpoint and atomic rename. The old configuration remains current until rename succeeds; ordinary saves read current configuration under the same mutex. Failed rename preserves the old file and state and allows retry.
Cancellation after rename can hide a successful return from the caller. The store publishes committed configuration before leaving the I/O block and exposes it for ownership reconciliation. Callers retain admission while the store uses the configuration.
Stacked on #219; advances #162. Tests cover successful/repeated persistence, injected rename failure, retry, and cancellation precisely after rename. Session edit commands and their retained-owner reconciliation remain separate work.
Validation: 566 JVM and 545 executed iOS simulator tests, zero failures/errors/skips; native-runtime guard and both pinned v1 conformance scenarios passed.