This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new e2352e1cc test(go/adbc/driver/flightsql): drain bound-param stream in 
testserver DoPut (#4497)
e2352e1cc is described below

commit e2352e1cc34f13f28b8de208c23001263c4628db
Author: Fredrik Fornwall <[email protected]>
AuthorDate: Mon Jul 13 10:23:37 2026 +0200

    test(go/adbc/driver/flightsql): drain bound-param stream in testserver 
DoPut (#4497)
    
    The FlightSQL test server's `DoPutPreparedStatementQuery` handler
    returned without consuming the client's bound-parameter request stream.
    gRPC tears the stream down as soon as the handler returns, so it might
    happen that (observed on arm64 macOS CI) the client's in-flight
    parameter send races the teardown and surfaces as a spurious "EOF
    (Unknown; ExecuteQuery)" instead of the real response, flaking
    `test_stateless_prepared_statement`.
    
    Drain the reader before returning so the handler consumes the full
    request stream, per gRPC's contract, removing the race.
    
    Signed-off-by: Fredrik Fornwall <[email protected]>
---
 go/adbc/driver/flightsql/cmd/testserver/main.go | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/go/adbc/driver/flightsql/cmd/testserver/main.go 
b/go/adbc/driver/flightsql/cmd/testserver/main.go
index 5a38b3e11..3e0c7f1ed 100644
--- a/go/adbc/driver/flightsql/cmd/testserver/main.go
+++ b/go/adbc/driver/flightsql/cmd/testserver/main.go
@@ -452,6 +452,14 @@ func (srv *ExampleServer) DoGetStatement(ctx 
context.Context, cmd flightsql.Stat
 
 func (srv *ExampleServer) DoPutPreparedStatementQuery(ctx context.Context, cmd 
flightsql.PreparedStatementQuery, reader flight.MessageReader, writer 
flight.MetadataWriter) ([]byte, error) {
        srv.recordHeaders(ctx, "DoPutPreparedStatementQuery")
+       // Drain the bound-parameter stream before returning. gRPC tears the 
stream
+       // down as soon as this handler returns, so if the server returns 
without
+       // consuming the client's request messages the client's in-flight 
parameter
+       // send can race the teardown and surface as a spurious "EOF (Unknown)"
+       // instead of the real response. Draining removes that race and matches
+       // gRPC's contract that a handler consume the full request stream.
+       for reader.Next() {
+       }
        switch string(cmd.GetPreparedStatementHandle()) {
        case "error_do_put":
                return nil, status.Error(codes.Unknown, "expected error 
(DoPut)")

Reply via email to