Skip to content

fix(bigtable): ensure deadline is respected for read_rows_sharded#17352

Open
daniel-sanche wants to merge 1 commit into
mainfrom
bigtable_flake
Open

fix(bigtable): ensure deadline is respected for read_rows_sharded#17352
daniel-sanche wants to merge 1 commit into
mainfrom
bigtable_flake

Conversation

@daniel-sanche
Copy link
Copy Markdown
Contributor

The read_rows_sharded tests were flaky. It seems this mostly came down to not having a mutex on the timeout generator, which isn't completely thread safe in the sync context. This ensures that the timeout is always accessed sequentially

Also increase the timeout in the test, to prevent future flakes

@daniel-sanche daniel-sanche requested a review from a team as a code owner June 2, 2026 20:58
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a lock (gen_lock) to ensure that rpc_timeout_generator is thread-safe during sharded row reads in both the async and sync clients. Additionally, it updates the unit tests to use CrossSync.sleep and CrossSync._Sync_Impl.sleep instead of asyncio.sleep, and increases the test operation timeout. A review comment correctly identifies a missing import of CrossSync in the async unit tests, which would lead to a NameError during execution.

Copy link
Copy Markdown
Contributor

@chalmerlowe chalmerlowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants