Repository navigation
An engine's stderr sink keeps draining when its file cannot be written or a line is not UTF-8 (card a6481313) - #5532
Merged
joelteply merged 2 commits intoOct 27, 2026
Conversation
…n or a line is not UTF-8 (card a6481313) child_log's own contract: "If the file cannot be written we keep draining and discard, and say so once". But pump() returned on the first write or open error, and lines() returned on the first line that was not UTF-8; either dropped the engine's stderr reader, so its log and the stall evidence's silent_ms (#5528) went dark for the rest of its life. - pump reads lines as bytes and decodes them lossily; only a read error (the child's stderr closing) ends it. - A failed open, write or rotation drops the file, says so once (serving.llama.log_sink_degraded), and keeps draining and discarding; it tries the file again every REOPEN_AFTER_LINES discarded lines and says when it recovers (serving.llama.log_sink_recovered). Tests (unix): a child writing 4000 non-UTF-8 lines into an unwritable sink runs to completion and the drain ends with it; non-UTF-8 output is logged with replacement characters and the lines after it are logged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…e length counts as full (Codex on #5532) Reopening after a failure (and after a rotation) set written=0, so repeated failures and reopens could grow one file past MAX_BYTES. open_counted reads the file's length on every open; an unreadable length is treated as full, so the next line rotates. Test: the directory is missing at first, a near-full log appears while the child pauses, the reopen counts it and rotates, and neither generation passes the cap. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
Contributor
Author
|
PASS on exact e00afd1. The previous reopen-length blocker is addressed: initial, recovered and rotated append handles now count existing bytes; unavailable metadata forces rotation. Reviewed the near-cap recovery fixture plus invalid-UTF8 and unavailable-sink drain cases. The drain continues observing lines during sink failure and bounds reopen attempts. Independently verified all selected CI checks passed or intentionally skipped, including engine tests. No local build beside active serving. This is source/test approval; deployment and live fault evidence remain separate. |
joelteply
deleted the
a6481313/child-log-s-pump-stops-draining-on-a-wri
branch
October 27, 2026 15:41
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.
Why
An engine whose stderr stops being drained logs nowhere. That costs the diagnosis of any stall and darkens #5528's
silent_ms(plan line 6: every fast-path miss loud).child_log's own contract says: "If the file cannot be written we keep draining and discard, and say so once". Butpump()returned on the first open or write error, andlines()returned on the first line that was not UTF-8. Either one dropped the engine's stderr reader for the rest of its life. Card a6481313, found while building #5528.What
pumpreads lines as bytes and decodes them lossily. Only a read error, meaning the child's stderr has closed, ends it.serving.llama.log_sink_degraded), and keeps draining and discarding.REOPEN_AFTER_LINES(1024) discarded lines, so a full disk isn't asked on every line, and says when it recovers (serving.llama.log_sink_recovered).write_line.Verified (enrico, 2026-10-27, head d6275c4)
REOPEN_AFTER_LINEScarries itsderived-or-floor:reason.sh):an_unwritable_sink_keeps_draining_the_child: a child writes 4000 lines with non-UTF-8 bytes (about 200 KB, well past the pipe buffer) into a sink whose directory doesn't exist. It exits successfully within the timeout, and the drain ends with it.output_that_is_not_utf8_is_logged_lossily_and_draining_continues: three such lines are all logged, with replacement characters.continuum-engine. enrico is serving, and IntelMac's builds go to CI, so CI is the compile.🤖 Generated with Claude Code
https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE