This repository was archived by the owner on Nov 12, 2025. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork45
This repository was archived by the owner on Nov 12, 2025. It is now read-only.
Avoid (potential) infinite reconnect loops in reader module #219
Closed
Description
Currently we always reconnect on "RST_STREAM" errors:
python-bigquery-storage/google/cloud/bigquery_storage_v1/reader.py
Lines 147 to 151 in7e4224e
| except_STREAM_RESUMPTION_EXCEPTIONS: | |
| # Transient error, so reconnect to the stream. | |
| pass | |
| self._reconnect() |
This may cause some infinite loops, especially if we add other errors such as UNAUTHENTICATED to the stream resumption logic to support customer issue 191460918. Pub/Sub and Firestore have already solved this with the shared BiDi (bi-directional) classes.
Resources:
- BiDi was added to google-api-core in:Move bidi to api-core google-cloud-python#6211
- _Throttle avoids infinite loops:https://github.com/googleapis/python-api-core/blob/d368c4b1a7761b30e7a004dd5f85c5b1edaf1e89/google/api_core/bidi.py#L140-L204
- Used in BiDi here:https://github.com/googleapis/python-api-core/blob/d368c4b1a7761b30e7a004dd5f85c5b1edaf1e89/google/api_core/bidi.py#L475-L477