Skip to content

blog: Document writer concurrency requirement of the audit handler - #8848

Merged
aarongable merged 1 commit into
reland-slogfrom
slog-audit/09-blog-audit-writer-comment
Jul 6, 2026
Merged

blog: Document writer concurrency requirement of the audit handler#8848
aarongable merged 1 commit into
reland-slogfrom
slog-audit/09-blog-audit-writer-comment

Conversation

@beautifulentropy

@beautifulentropy beautifulentropy commented Jul 6, 2026

Copy link
Copy Markdown
Member

The audit and plain sub-handlers each hold only their own internal lock, so the shared underlying writer receives concurrent whole-line Write calls from both. Every current writer tolerates this (os.File serializes concurrent Write calls internally, and syslog.Writer and the test mock hold their own locks), but the requirement is invisible at the io.Writer interface. Document it at the point where a future writer (for example a bufio.Writer added while moving to stdout-only logging) would be inserted.

This PR was generated as part of an audit of #8606 using Claude Fable 5.

The audit and plain sub-handlers each hold only their own internal
lock, so the shared underlying writer receives concurrent whole-line
Write calls from both. Every current writer tolerates this (os.File
serializes concurrent Write calls internally, and syslog.Writer and
the test mock hold their own locks), but the requirement is invisible
at the io.Writer interface. Document it at the point where a future
writer (for example a bufio.Writer added while moving to stdout-only
logging) would be inserted.
@beautifulentropy
beautifulentropy requested a review from a team as a code owner July 6, 2026 19:03
@beautifulentropy beautifulentropy changed the title blog: document writer concurrency requirement of the audit handler blog: Document writer concurrency requirement of the audit handler Jul 6, 2026
@aarongable
aarongable changed the base branch from main to reland-slog July 6, 2026 21:20
@aarongable
aarongable merged commit 644f6bc into reland-slog Jul 6, 2026
18 checks passed
@aarongable
aarongable deleted the slog-audit/09-blog-audit-writer-comment branch July 6, 2026 21:44
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.

3 participants