firebase / firebase/firebase-admin-python

Firebase Admin not retried on auth request connection error

未關閉
#852 1 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
api: core
主要語言
Python
星號
1.2k
分支
359
平均合併
5 天 6 分鐘
30 天內合併 PR
2

描述

Even though `DEFAULT_RETRY_CONFIG` is good enough
```py
DEFAULT_RETRY_CONFIG = retry.Retry(
connect=1, read=1, status=4, status_forcelist=[500, 503],
raise_on_status=False, backoff_factor=0.5, **_ANY_METHOD)
```
I'm still periodically getting `('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))`. I started thinking it is very weird, because it seems that this connection error should be retried, no? It turned out, that this connection error occurs not in the request itself, which properly retries connection errors. It happens inside `AuthorizedSession.credentials.before_request`, which for auth requests instead of `DEFAULT_RETRY_CONFIG` uses
```py
retry_adapter = requests.adapters.HTTPAdapter(max_retries=3)
```

I think the right approach would be to form `auth_request` manually with the correct retry config in `HttpClient.__init__` and pass it to `AuthorizedSession` on creation.

What are your thoughts?

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。