Restore message logging and clear write state on exceptional exits - #71
Open
OskarEichler wants to merge 1 commit into
Open
Restore message logging and clear write state on exceptional exits#71OskarEichler wants to merge 1 commit into
OskarEichler wants to merge 1 commit into
Conversation
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.
Summary
Restore temporarily disabled message logging and clear temporary write buffers/counters with ensure when reads, sources, writes or user blocks exit exceptionally. Do not finish or send the message terminator on failure.
Reproduction
Focused checks cover reader EOF and block exceptions, nonlocal read exits, failing enumerable sources and IO writes, nonlocal writer breaks, successful empty/dot-stuffed/unterminated messages, exact byte counts and ordinary BufferedIO write failure. Original exceptions/return values are preserved.
Verification
6cba9756b72eaa5a939b4cb6e032ec1da88b07bd.bundle exec rake test: 30 tests, 66 assertions, zero failures/errors on the baseline and this branch.git diff --checkpass. Supplemental RuboCop Lint has the same 11 pre-existing offenses; no lint-clean claim.Compatibility and limitations
No signature changes or successful wire-format changes. Logging is restored after failure, and failed calls no longer retain partial message data/counters. This cleanup does not make a partially failed protocol exchange safe to resume; callers must retain their existing connection-disposal behavior.
The patch also applies to installed release 0.3.0, whose runtime file matches the reviewed master. Gem version, dependencies and Ruby >= 2.6 requirement stay unchanged. Only macOS/Ruby 4.0.6 was run locally; other Ruby/OS combinations require upstream CI. No production traffic or external service was used.