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 }}
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
Deadlock due to race condition in download thread when using Bigquery Storage API #2032
api: bigqueryIssues related to the googleapis/python-bigquery API.policybotpriority: p3Desirable enhancement or fix. May not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
# No need for a lock because reading/replacing a variable is
# defined to be an atomic operation in the Python language
# definition (enforced by the global interpreter lock).
download_state.done=True
# Shutdown all background threads, now that they should know to
# exit early.
pool.shutdown(wait=True)
When the download thread is blocked on worker_queue.put(item), if the main thread exit, causing the pool to shut down, the download thread will be stuck. This behavior prevents the program from exiting.
FWIW: We think this was affecting the BigQuery DataFrames benchmark tests. Basically, if one starts iterating through the dataframe pages but then stops iterating through, the workers would stay producing messages and never go totally out of scope / shutdown.
api: bigqueryIssues related to the googleapis/python-bigquery API.policybotpriority: p3Desirable enhancement or fix. May not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
Activity
kien-truong commentedon Nov 16, 2024
@chalmerlowe can you take a look at this issue and my corresponding PR #2034? thanks
tswast commentedon Feb 3, 2025
FWIW: We think this was affecting the BigQuery DataFrames benchmark tests. Basically, if one starts iterating through the dataframe pages but then stops iterating through, the workers would stay producing messages and never go totally out of scope / shutdown.