Content-Length: 284991 | pFad | http://github.com/googleapis/python-bigquery/commit/54c8d07f06a8ae460c9e0fb1614e1fbc21efb5df

E4 fix: avoid blocking in download thread when using BQ Storage API (#2034) · googleapis/python-bigquery@54c8d07 · GitHub
Skip to content

Commit 54c8d07

Browse files
kien-truongchalmerlowetswast
authored
fix: avoid blocking in download thread when using BQ Storage API (#2034)
This prevents a deadlock between the main thead and download threads when the threadpool is shutdown prematurely. Co-authored-by: Chalmer Lowe <chalmerlowe@google.com> Co-authored-by: Tim Sweña (Swast) <swast@google.com>
1 parent 3a48948 commit 54c8d07

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

google/cloud/bigquery/_pandas_helpers.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -796,10 +796,15 @@ def _download_table_bqstorage_stream(
796796
rowstream = reader.rows(session)
797797

798798
for page in rowstream.pages:
799-
if download_state.done:
800-
return
801799
item = page_to_item(page)
802-
worker_queue.put(item)
800+
while True:
801+
if download_state.done:
802+
return
803+
try:
804+
worker_queue.put(item, timeout=_PROGRESS_INTERVAL)
805+
break
806+
except queue.Full: # pragma: NO COVER
807+
continue
803808

804809

805810
def _nowait(futures):

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/googleapis/python-bigquery/commit/54c8d07f06a8ae460c9e0fb1614e1fbc21efb5df

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy