Skip to content

fix(logging): use write_all for atomic JSONL line writes (#108)#59

Open
chris-sevorix wants to merge 1 commit into
mainfrom
sync/watchtower-5f187a4
Open

fix(logging): use write_all for atomic JSONL line writes (#108)#59
chris-sevorix wants to merge 1 commit into
mainfrom
sync/watchtower-5f187a4

Conversation

@chris-sevorix

Copy link
Copy Markdown
Contributor

Replace writeln! with format+write_all in log_traffic_event and
sign_and_log_traffic_event so each log line is written in a single
write(2) syscall. POSIX O_APPEND atomicity guarantees are per-syscall;
writeln! expands to two syscalls (content + newline) which Tokio tasks
can interleave, producing concatenated receipts on a single line.

Fixes #106.

Co-authored-by: cjhoogenboom <chrishoogenboom102599@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant