Repository navigation
Commit 31d9365
authored
feat(bigquery-storage): send gRPC keepalive pings by default (#18792)
Makes `BigQueryReadClient` send gRPC keepalive pings by default.
`ReadRows` streams 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.
- Uses a gRPC channel with `grpc.keepalive_time_ms` and
`grpc.keepalive_timeout_ms` set to 60s when no `transport` is passed (or
`transport="grpc"`).
- Leaves a caller's transport instance or callable unchanged.
- Adds unit tests for the default channel options and for
caller-provided transports.
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_calls` isn't set). A read on a dropped
connection now fails with `UNAVAILABLE` after about 2 minutes instead of
hanging, and `ReadRowsStream` already reconnects on that.
google-cloud-bigtable and google-cloud-firestore already send keepalive
pings by default, every 30s.
Fixes #187841 parent 89cbc50 commit 31d9365
2 files changed
Lines changed: 78 additions & 0 deletions
File tree
- packages/google-cloud-bigquery-storage
- google/cloud/bigquery_storage_v1
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
40 | 65 | | |
41 | 66 | | |
42 | 67 | | |
43 | 68 | | |
44 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
45 | 74 | | |
46 | 75 | | |
47 | 76 | | |
48 | 77 | | |
49 | 78 | | |
| 79 | + | |
| 80 | + | |
50 | 81 | | |
51 | 82 | | |
52 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
0 commit comments