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: d6b88c6d08
ℹ️ 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".
| } | ||
| checkNotNull(root(create = false)) | ||
| // Another catalog instance may already have published the same authenticated object. | ||
| if (read(target, identity) == null) fileSystem.atomicMove(temp, target) |
There was a problem hiding this comment.
Avoid replacing a target created after the final check
When another process creates or corrupts the target after read(target, identity) returns null but before this call, Okio's atomicMove replaces the existing destination, so put overwrites an entry that it never authenticated despite the catalog's non-overwrite guarantee. Publication needs a no-replace primitive or equivalent synchronization, followed by authentication of the winning target when the destination already exists.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 5d61004. Catalog publication now uses atomic no-replace hard-link creation (Files.createLink on JVM/Android, POSIX link on iOS), then authenticates the winning target whether publication succeeded or another entry already existed. There is no replacing-move fallback. The regression creates valid and invalid competing targets at the publication boundary and proves they remain unchanged. All six catalog tests pass and the iOS simulator implementation compiles.
5d61004 to
c1fc31f
Compare
|
Superseded by #234 (V2 catalog, checkpoints and crash recovery) 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) |
Persist authenticated raw info and piece layers in a bounded catalog addressed by full v2 identity. Hybrid reads authenticate all requested topics; exact info bytes are retained, while tracker URLs, comments and other caller context are omitted. Existing entries are validated before reuse and corrupt objects are rejected without overwrite.
Publication flushes a uniquely created temporary object before atomic no-replace hard-link publication and cleans up its unchanged temporary file on failure. Reads enforce the 32 MiB bound before loading and reject growth during the read.
Stack: based on #179, advancing #162 step 07. Runtime admission, streaming/spilling at full layer limits, catalog references/GC, directory-fsync power-loss guarantees, checkpoint v2 references and task ownership persistence remain pending. This does not by itself enable restart of downloads.
Validation: six focused catalog tests and iOS simulator compilation pass for the publication-race fix. New catalog tests cover reopening, caller-context separation, hybrid topics and external layers, corrupt/oversized objects, publication failure/retry, and valid/invalid competing-target races. The inherited #179 fix flushes rechecked files once and revokes tentative pieces on flush failure.