Repository navigation
fix(id/world): let fork tolerate a crash-torn journal tail (#1523) - #2933
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 39 minutes. View limit details
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. |
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. |
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.
Fixes #1523 — queue task 1828 (triage task 1569, verified on main).
What
FileJournal::opentreats an unterminated last journal line as a crash-torn append (dropped with a warning, truncated), butread_journal_entries— the strict helperfork_worldreads cold source journals through — parsed every non-empty chunk and failed the whole read as corrupt. A crash-torn world opened fine but could never be forked.pkgs/id/src/world_store.rs:read_journal_entriesnow excludes an unterminated final fragment (the split chunk after the last\nwhen the file does not end in one) with the sametracing::warn!"dropping torn final entry at byte N" messageopenuses. Newline-terminated unparseable lines stay fatal with the existingis corrupterror, in any position including the last line.FileJournal::append's Define rollback compatibility for world profile journal entries #227 version-bump path also reads through this helper, but only on journalsopenhas already truncated, so its behaviour is unchanged.ExecutionProfileappend that rustfmt on main already wants collapsed) is included so the file is fmt-clean.Tests
New in
pkgs/id/tests/world_fork.rs:a_fork_tolerates_a_crash_torn_journal_tail— torn fragment appended raw after close; fork succeeds and replays to the last complete entry (header rewritten, install copied, provenance recorded).a_fork_refuses_a_corrupt_but_complete_final_line— newline-terminated garbage as the final line; fork fails with the corrupt error.Verified on the laptop:
cargo test --no-default-features --features world --test world_fork4/4 pass;cargo test --lib world_store21/21 pass.Need help on this PR? Tag
@codesmith-botwith what you need.