This repository was archived by the owner on Apr 1, 2026. It is now read-only.
Commit 544db1c
authored
fix: async client uses fixed grace period (#1236)
Previously, when a channel refresh occurs, the async client would use
`channel.close()` with a grace parameter to allow previous channels to
keep serving old requests for a time. We were seeing flakes in our
tests, showing that `channel.close()` isn't reliable, and can sometimes
cancel ongoing requests before the grace period ends
This PR fixes this by using a fixed sleep time before calling close in
the async client, like the sync client already does. This should remove
the potential for cancelled requests before the grace period ends, and
improve test flakiness
I also updated the system test to fully capture this problematic state,
instead of encountering it in a random race condition1 parent 2a5baf1 commit 544db1cCopy full SHA for 544db1c
4 files changed
+67-69Lines changed: 67 additions & 69 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- google/cloud/bigtable/data
- _async
- _sync_autogen
- tests/system/data
Expand file treeCollapse file tree
Open diff view settings
Collapse file
google/cloud/bigtable/data/_async/client.py
Copy file name to clipboardExpand all lines: google/cloud/bigtable/data/_async/client.py+5-6Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
481 | 481 | |
482 | 482 | |
483 | 483 | |
484 | | - |
485 | | - |
486 | | - |
487 | | - |
488 | | - |
489 | | - |
| 484 | + |
| 485 | + |
| 486 | + |
| 487 | + |
| 488 | + |
490 | 489 | |
491 | 490 | |
492 | 491 | |
|
Collapse file
google/cloud/bigtable/data/_sync_autogen/client.py
Copy file name to clipboardExpand all lines: google/cloud/bigtable/data/_sync_autogen/client.py+3-1Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
365 | 365 | |
366 | 366 | |
367 | 367 | |
368 | | - |
| 368 | + |
| 369 | + |
| 370 | + |
369 | 371 | |
370 | 372 | |
371 | 373 | |
|
Collapse file
tests/system/data/test_system_async.py
Copy file name to clipboardExpand all lines: tests/system/data/test_system_async.py+37-37Lines changed: 37 additions & 37 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
266 | 266 | |
267 | 267 | |
268 | 268 | |
269 | | - |
270 | | - |
| 269 | + |
271 | 270 | |
272 | | - |
273 | | - |
274 | | - |
275 | | - |
276 | | - |
| 271 | + |
| 272 | + |
| 273 | + |
| 274 | + |
| 275 | + |
| 276 | + |
| 277 | + |
| 278 | + |
277 | 279 | |
278 | 280 | |
279 | | - |
280 | | - |
| 281 | + |
| 282 | + |
| 283 | + |
281 | 284 | |
282 | 285 | |
283 | | - |
284 | | - |
| 286 | + |
| 287 | + |
| 288 | + |
285 | 289 | |
286 | | - |
287 | | - |
288 | | - |
289 | | - |
290 | | - |
291 | | - |
292 | | - |
293 | | - |
294 | | - |
295 | | - |
296 | | - |
297 | | - |
298 | | - |
299 | | - |
300 | | - |
301 | | - |
302 | | - |
303 | | - |
304 | | - |
305 | | - |
306 | | - |
307 | | - |
308 | | - |
309 | | - |
310 | | - |
311 | | - |
| 290 | + |
| 291 | + |
| 292 | + |
| 293 | + |
| 294 | + |
| 295 | + |
| 296 | + |
| 297 | + |
| 298 | + |
| 299 | + |
| 300 | + |
| 301 | + |
| 302 | + |
| 303 | + |
| 304 | + |
| 305 | + |
| 306 | + |
| 307 | + |
| 308 | + |
| 309 | + |
| 310 | + |
| 311 | + |
312 | 312 | |
313 | 313 | |
314 | 314 | |
|
Collapse file
tests/system/data/test_system_autogen.py
Copy file name to clipboardExpand all lines: tests/system/data/test_system_autogen.py+22-25Lines changed: 22 additions & 25 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
221 | 221 | |
222 | 222 | |
223 | 223 | |
224 | | - |
225 | | - |
226 | | - |
227 | | - |
228 | | - |
229 | | - |
| 224 | + |
| 225 | + |
| 226 | + |
| 227 | + |
| 228 | + |
| 229 | + |
| 230 | + |
| 231 | + |
230 | 232 | |
231 | 233 | |
232 | | - |
233 | | - |
| 234 | + |
| 235 | + |
| 236 | + |
234 | 237 | |
235 | 238 | |
236 | | - |
| 239 | + |
237 | 240 | |
238 | | - |
239 | | - |
240 | | - |
241 | | - |
242 | | - |
243 | | - |
244 | | - |
245 | | - |
246 | | - |
247 | | - |
248 | | - |
249 | | - |
250 | | - |
251 | | - |
252 | | - |
253 | | - |
| 241 | + |
| 242 | + |
| 243 | + |
| 244 | + |
| 245 | + |
| 246 | + |
| 247 | + |
| 248 | + |
| 249 | + |
| 250 | + |
254 | 251 | |
255 | 252 | |
256 | 253 | |
|
0 commit comments