Repository navigation
fix(runtime): discard incomplete active TCP lines at close - #95
Merged
Merged
Conversation
On Linux and other systems using Nera’s event-based TCP reader, the program no longer receives an unfinished last line when the peer closes. Complete lines still arrive with their line endings, as on BEAM.
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
Nera treated an unfinished line as a complete packet when the peer closed, so an Erlang program could act on a truncated command.
What changed
Before and after
Before: Sending STATUS with a line ending, then an unfinished QUIT, delivered both commands as data before the close notification.
After: The same exchange delivers STATUS with its line ending, then the close notification; an unfinished line on its own delivers only the close notification.
This changes the sequence of messages an Erlang program receives, not a screen.
Checked
Live validation: Demonstrated for this version. 2 of 2 scenarios driven live in the product.
How it was checked
The native fixture exercised active true and active once, preserved a preceding CRLF line, and checked for already queued messages after close without waiting.
Workspace Clippy, the CI change-map tests, allocator configuration, stacktrace order and native test storage passed.
Cross-object checks produced x86-64 Mach-O and AArch64 ELF objects; they do not establish native execution on those targets.
The workspace passed with the standard umask. The inherited group-writable umask exposes a separately tracked storage fixture defect.
Risk
Risk: low in every dimension.
Full risk assessment
Not done
Approval puts this change in the next batch. The batch merges only after its hosted integration and platform checks pass.
Passive line framing and buffered prefixes when re-arming a still-open socket are unchanged.
The alternate reader drops an unfinished line at end of input, but still reads only once per activation. Windows behavior was not exercised.