Repository navigation
THRIFT-6573: End only the failed listen pipe in the netstd TNamedPipeServerTransport - #4222
Merged
Merged
Conversation
…ServerTransport Client: netstd Since THRIFT-6539, AcceptImplementationAsync() closed the whole server transport when the wait of one listen pipe failed. With more than one listen pipe, the clients that had connected to the other pipes, and were not accepted yet, lost their connection. A failed wait now ends only its own pipe. The call still throws TTransportException(NotOpen) with the error, which TSimpleAsyncServer and TThreadPoolAsyncServer log before they accept the next client. The other listen pipes keep their clients and go on waiting, and the next call sets up a new pipe in place of the failed one. The new test puts a listen pipe whose wait has failed (inserted by reflection) ahead of the pipe a client is connected to. It checks that the call closes the failed pipe and that the next call returns that client's connection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
THRIFT-6573
Since THRIFT-6539, a failed wait of one listen pipe reaches the catch block of
TNamedPipeServerTransport.AcceptImplementationAsync(), and itsClose()disconnects and disposes every listen pipe. With more than one listen pipe, clients that had connected to one of the other pipes, and had not been accepted yet, lost their connection.Now a failed wait ends only its own pipe:
TTransportException(NotOpen)with the error, whichTSimpleAsyncServerandTThreadPoolAsyncServerlog before they accept the next client. It is thrown after thetryblock, so the catch blocks'Close()does not run for it.Cancellation,
Close()during the wait and a connected client are handled as before.TNamedPipeServerTransportTestsgainsAcceptAsync_WaitOfOnePipeFailed_KeepsClientOfOtherPipe. The test needs a failed wait on demand, so it puts a listen pipe whose wait has failed (by reflection) ahead of the pipe a second client is connected to:NotOpenwith the injected error and closes the failed pipeOn Linux with the .NET 11 SDK:
TNamedPipeServerTransportTests15/15 (20 repeated runs),Thrift.Tests341/341,Thrift.IntegrationTests57/57, and the Release build ofThrift.csprojfor netstandard2.0, netstandard2.1, net10.0 and net11.0 without warnings. The MSVC job runs the test on Windows.🤖 Generated with Claude Code