Skip to content

Commit 1fb0e64

Browse files
authored
fix(bigquery/storage/managedwriter): faster context failure on send (#10169)
This is a minor PR that accelerates the failure loop for context expiration cases. Previously, the connection abstraction would deal with expired context on the receiver side, and this change simply checks context before allowing a new append to succeed. Tests already existed that exhibited this behavior, but were timing dependent and masked the issue (the receiver would close the connection fast enough). Fixes: https://togithub.com/googleapis/google-cloud-go/issues/10128
1 parent a495f8f commit 1fb0e64

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

β€Žbigquery/storage/managedwriter/connection.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,11 @@ func (co *connection) lockingAppend(pw *pendingWrite) error {
369369
}
370370
}()
371371

372+
// If connection context is expired, error.
373+
if err := co.ctx.Err(); err != nil {
374+
return err
375+
}
376+
372377
var arc *storagepb.BigQueryWrite_AppendRowsClient
373378
var ch chan *pendingWrite
374379
var err error

0 commit comments

Comments
 (0)