googleapis / googleapis/google-cloud-python

Google Big Query Write append_rows does not respect retry configuration

未关闭
#14,275 18 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
api: bigquerystorage priority: p3 type: bug
主要语言
Python
星标
5.4k
派生
1.8k
平均合并
3 天 4 小时
30 天内合并 PR
122

描述

Default configuration for append_rows() call [here](https://github.com/googleapis/python-bigquery-storage/blob/v2.19.1/google/cloud/bigquery_storage_v1/services/big_query_write/transports/base.py#L154) and [here](https://github.com/googleapis/python-bigquery-storage/blob/v2.19.1/google/cloud/bigquery_storage_v1/services/big_query_write/async_client.py#L468) sets that by default request would be retired in case of `google.api_core.exceptions.ServiceUnavailable` exception with a timeout of 1 day. However I observed that in case of this server response it raises this exception without retrying the call.

#### Environment details

- OS type and version: Debian 11
- Python version: `3.11.2`
- pip version: `22.3.1`
- `google-cloud-bigquery-storage` version: `2.19.0`

#### Steps to reproduce

1. Create async iterator that is yielding new rows with some random delay
2. Start new stream and use async iterator created in step 1 to pass it to the `append_rows()`
3. Observe that occassionally this process fails without retrying, even with errors that are passed to the default retry config as a `predicate`

#### Stack trace
```
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/google/api_core/grpc_helpers_async.py", line 73, in wait_for_connection
await self._call.wait_for_connection()
File "/usr/local/lib/python3.11/site-packages/grpc/aio/_call.py", line 483, in wait_for_connection
await self._raise_for_status()
File "/usr/local/lib/python3.11/site-packages/grpc/aio/_call.py", line 236, in _raise_for_status
raise _create_rpc_error(await self.initial_metadata(), await
grpc.aio._call.AioRpcError:

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/app/src/reporter/backends/bigquery.py", line 144, in _stream_exceptions_task
await self.exceptions_bq_stream.stream(self.exceptions_iterator)
File "/usr/local/lib/python3.11/site-packages/prisjakt_ingestion_utils/clients/gcp_big_query/gcp_big_query_stream.py", line 130, in stream
stream = await self.client.append_rows(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/google/api_core/grpc_helpers_async.py", line 179, in error_remapped_callable
await call.wait_for_connection()
File "/usr/local/lib/python3.11/site-packages/google/api_core/grpc_helpers_async.py", line 75, in wait_for_connection
raise exceptions.from_grpc_error(rpc_error) from rpc_error
google.api_core.exceptions.ServiceUnavailable: 503 recvmsg:Connection reset by peer
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。