Closed
Description
Currently we always reconnect on "RST_STREAM" errors:
python-bigquery-storage/google/cloud/bigquery_storage_v1/reader.py
Lines 147 to 151 in 7e4224e
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