firebase / firebase/firebase-admin-python

Firebase Admin not retried on auth request connection error

Offen
#852 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
api: core
Vorherrschende Sprache
Python
Sterne
1.2k
Forks
359
Ø Merge
5 T. 6 Min.
Gemergte PRs (30 T.)
2

Beschreibung

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?

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.