Repository navigation
Conversation
A ReadRows stream can sit idle for a long time, for example while BigQuery finishes a query job before the first row. Without keepalive pings, a NAT or load balancer can drop the idle connection without telling either side. BigQueryReadClient now uses a gRPC channel with keepalive pings when no transport is passed. A transport passed by the caller is used as given. Fixes #18784
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces default gRPC keepalive pings (60 seconds) for the BigQueryReadClient to prevent idle ReadRows streams from being dropped by NATs or load balancers, along with corresponding unit tests. Feedback on the changes highlights a potential issue where unconditionally appending default keepalive options could override custom user-configured channel options. It is recommended to check for existing keepalive keys in the options list before appending the defaults.
ohmayr
marked this pull request as ready for review
October 20, 2026 20:45
ohmayr
requested review from
sycai and
tswast
and removed request for
a team and
sycai
October 20, 2026 20:45
This branch has not been deployed
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.
Makes
BigQueryReadClientsend gRPC keepalive pings by default.ReadRowsstreams can sit idle for a long time, for example while BigQuery finishes a query job, and without pings a NAT or load balancer can drop the idle connection without telling either side. google-cloud-bigquery works around this with its own transport for Arrow query results (#18652). This moves the setting here, so every long read gets it.grpc.keepalive_time_msandgrpc.keepalive_timeout_msset to 60s when notransportis passed (ortransport="grpc").This changes the default channel for every bigquery-storage user, but normal table reads shouldn't notice: pings only go out while a call is open and the connection has been quiet for 60s (
keepalive_permit_without_callsisn't set). A read on a dropped connection now fails withUNAVAILABLEafter about 2 minutes instead of hanging, andReadRowsStreamalready reconnects on that. google-cloud-bigtable and google-cloud-firestore already send keepalive pings by default, every 30s.Fixes #18784