Fix stale read/write/connect state leaking across named pipe reuse on Windows - #2002
Open
Dantsz wants to merge 17 commits into
Open
Fix stale read/write/connect state leaking across named pipe reuse on Windows#2002Dantsz wants to merge 17 commits into
Dantsz wants to merge 17 commits into
Conversation
… of read and writes with wrong generation
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.
Fixes #1983.
Read and write completions now carry the generation they were issued under (inspired by the Solaris Event Port implementation), so results from an in-flight operation that outlived the connection are discarded instead of leaking to the next client.
disconnectbumps that generation and cancels or clears the pending read/write state.connecttracks its own generation so an abortedConnectNamedPipecan no longer park a stale error for the next successful connection.Regression tests added:
issue_1983— two connect/read/disconnect rounds on one instance(from issue)issue_1983_2— read still pending at disconnectissue_1983_3— completed but unread data buffered at disconnectissue_1983_4— write in flight when the client goes awayissue_1983_5— connect aborted by disconnect