fix(pty): log the cause when the PTY reader thread terminates#49
Open
roramirez wants to merge 1 commit into
Open
fix(pty): log the cause when the PTY reader thread terminates#49roramirez wants to merge 1 commit into
roramirez wants to merge 1 commit into
Conversation
The reader loop collapsed clean EOF and genuine I/O errors into a single `Ok(0) | Err(_) => break` arm, discarding the disconnection cause and making it invisible under `RUST_LOG`. Extract a pure `classify_read` that keeps EOF, error, and data as distinct outcomes, and a `pty_reader_loop` that logs the reason for every termination (EOF, read error, or closed output channel) at debug level. Add a regression test asserting `classify_read` distinguishes the three cases, plus an integration test that the reader thread terminates on PTY EOF instead of hanging.
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.
What
The PTY reader thread collapsed a clean EOF and a genuine I/O error into a single
Ok(0) | Err(_) => break, discarding the disconnection cause and making it invisible underRUST_LOG.Changes
classify_readfunction that keeps EOF, error, and data as distinct variants.pty_reader_looplogs the reason for every termination (EOF, read error, closed output channel) atdebuglevel.Tests
classify_readdistinguishes the three cases (regression: the distinction did not exist before).Card
plan-todo/04-hardening-pty-read-errores.md