Repository navigation
Conversation
|
|
…ke stream If a server finishes a handshake before the client writes or reads, GrpcClientAuthSender::Write() or GrpcClientAuthReader::Read() calls Finish() on the handshake stream. If the returned status is OK, AuthenticateInternal() continues and calls Finish() again. gRPC reports GRPC_CALL_ERROR_TOO_MANY_OPERATIONS for the second Finish() and aborts the process. This wraps the handshake stream to call Finish() at most once and skips WritesDone()/draining when the stream is already finished. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kou
force-pushed
the
flight-handshake-finish-once
branch
from
October 20, 2026 06:00
4768fd6 to
20e9a6d
Compare
kou
marked this pull request as ready for review
October 20, 2026 06:01
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.
Rationale for this change
arrow-flight-sql-odbc-testsometimes aborts withGRPC_CALL_ERROR_TOO_MANY_OPERATIONSinClientReaderWriter::Finish()of the handshake stream.This happens when a server finishes a handshake before the client writes or reads. For example,
NoOpAuthHandleron the server side and Dremio do this. In this case:GrpcClientAuthSender::Write()(orGrpcClientAuthReader::Read()) fails and callsFinish()on the handshake stream.AuthenticateInternal()continue.AuthenticateInternal()callsWritesDone(), drains the stream and callsFinish()again.RECV_STATUS_ON_CLIENTwithGRPC_CALL_ERROR_TOO_MANY_OPERATIONSand aborts the process.GRPC_TRACE=apishows this sequence:Whether the server finishes before the client writes is a race. So it's flaky.
What changes are included in this PR?
GrpcClientHandshakeStreamthat wraps the handshake stream:Finish()is called at most once. The second and later calls return the status of the first call.Read(),Write()andWritesDone()returnfalsewithout calling gRPC after the stream is finished.AuthenticateInternal()withoutWritesDone()and draining when the stream is already finished.Are these changes tested?
Yes.
Are there any user-facing changes?
Yes. Flight clients don't abort the process when a server finishes a handshake early.
Was AI used for this PR?
In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.
PR code and description written by:
Reviewed before submission by:
GRPC_CALL_ERROR_TOO_MANY_OPERATIONSerror in ODBC Linux #49818