A log line is one write, so the e2e cases read it whole #132
No reviewers
Labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
schaefera/utStudyBIble!132
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/log-line-atomic"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
The app's log lines from
coreare now written to stderr in one piece.eprintln!wrote each part of a line separately, so a line logged at the same moment by another thread (Qt's) could land in the middle of it. On main (run 247), the e2erestorecase readutsb: restored utsb: window loaded after 375 msand failed, although the position had been restored. The newlog_line!(core/src/log.rs) builds the whole line, then writes it once. The log text is unchanged.Blast radius
Tier: trunk
Trunk paths touched:
core/src/worker/session*,core/src/db.rs,core/src/tasks/exec.rs(only their log calls)Testing tier: standard
Gate / rollback: revert this merge (log output only; no data or behaviour change).
Proof
ac8f8b3: changes, rust, audit, app, e2e and click all succeeded.cargo makelocally: fmt, clippy, tests (coverage 94.97 % of lines), cargo-deny and cargo-audit pass.write_linewriting aseprintln!does,log::tests::a_line_is_one_writefails. The line goes out as["utsb: restored ", "KJV", " ", "20", " ", "0.", "341", "\n"], eight writes, the gaps that let Qt's line in. With the change it is one write.Review
Reviewer: fresh-context
code-reviewat high (review 350): 0 findings.Review-Confidence: 100/100. The review covered all the trunk files, the test is shown to fail without the change, and CI is green on the final commit. Only the cause is demonstrated, not the e2e symptom.
Confidence by part
log_line!and its uses: high. The text is unchanged, so the e2e and mem-check greps still match.restoreflake: medium. The log of run 247 shows this split. Qt's own lines are assumed to be written in one call, as its default handler does.🤖 Generated with Claude Code
claude-review, level high, commit
ac8f8b347d, range origin/main...HEAD.No high, medium or low findings. Checked: the macro_export path (
crate::log_line!) resolves in-crate; log lines keep byte-identical text so the e2e/mem-check greps (utsb: saved/restored/back to/jump from/switch from) are unaffected; noeprintln!remains in the app paths (only core/src/bible/refs/sweep.rs, a dev sweep, and sword examples/tests); qt/ has no Rust eprintln and its qInfo lines are outside this change. A singlewrite_allof a pre-formatted line is one write(2) for lines under PIPE_BUF, which is the intended fix; dropping a write error instead of panicking is the stated behavior.Files reviewed: core/src/log.rs, core/src/lib.rs, core/src/db.rs, core/src/tasks/exec.rs, core/src/worker/session.rs, core/src/worker/session/jump.rs, core/src/worker/session/switch.rs, core/src/bible/refs/sweep.rs, qt/main.cpp, tools/e2e/cases/*.sh (grep of log lines), clippy.toml, CLAUDE.md
WIP: A log line is one write, so the e2e cases read it wholeto A log line is one write, so the e2e cases read it wholeMerge gate, commit
ac8f8b3. Checked: review 350 (high) had no findings and there are no fix commits; no commits on the branch afterac8f8b3; CI green on head (changes, rust, audit, app, e2e, click all succeeded); PR body Proof lists no unrun elevated, maximum or AI-behaviour gate (it states the e2e interleaving is not reproduced, which is a disclosed limit); Review-Confidence 100. Approved.