Skip to content

Commit 084097b

Browse files
committed
Add 502/503/504 to the default request retry list
refs: #835, #441
1 parent b43b12e commit 084097b

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
### Changed
1515

1616
- Internal reorganization of `openeo.extra.job_management` submodule to ease future development ([#741](https://github.com/Open-EO/openeo-python-client/issues/741))
17+
- `openeo.Connection`: add some more HTTP error codes to the default retry list: `502 Bad Gateway`, `503 Service Unavailable` and `504 Gateway Timeout` ([#835](https://github.com/Open-EO/openeo-python-client/issues/835))
18+
1719

1820
### Removed
1921

openeo/extra/job_management/_manager.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,13 @@ def add_backend(
229229
parallel_jobs: int = 2,
230230
):
231231
"""
232-
Register a backend with a name and a Connection getter.
232+
Register a backend with a name and a :py:class:`Connection` getter.
233+
234+
.. note::
235+
For optimal throughput and responsiveness, it is recommended
236+
to provide a :py:class:`Connection` instance without its own (blocking) retry behavior,
237+
since the job manager will do retries in a non-blocking way,
238+
allowing to take care of other tasks before retrying failed requests.
233239
234240
:param name:
235241
Name of the backend.

openeo/utils/http.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
DEFAULT_RETRY_FORCELIST = frozenset(
4444
[
4545
HTTP_429_TOO_MANY_REQUESTS,
46+
HTTP_502_BAD_GATEWAY,
47+
HTTP_503_SERVICE_UNAVAILABLE,
48+
HTTP_504_GATEWAY_TIMEOUT,
4649
]
4750
)
4851

0 commit comments

Comments
 (0)