You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(spanner): CrossSync.queue_get with timeout <= 0 fails immediately even when queue is non-empty #19107
In packages/google-cloud-spanner/google/cloud/aio/_cross_sync/cross_sync.py, CrossSync.queue_get implements timeout using asyncio.wait_for(queue.get(), timeout=timeout):
When timeout <= 0 (for example, AsyncFixedSizePool(size=1, default_timeout=0) or AsyncPingingPool(size=1, default_timeout=0)), asyncio.wait_for(queue.get(), timeout=0) in Python 3.14 cancels queue.get() and raises asyncio.TimeoutError (asyncio.QueueEmpty) immediately even when the queue already contains an available session.
In contrast, the synchronous queue.Queue.get(block=True, timeout=0) returns an item immediately if one is in the queue and only raises queue.Empty if the queue is empty.
Expected Fix
Handle timeout <= 0 (or not block) via queue.get_nowait() in CrossSync.queue_get:
Activity
daniel-sanche commentedon Nov 17, 2026
Would you be in favor of us adding CrossSync to api_core, so we can avoid maintaining duplicate copies across spanner and bigtable?