Skip to content

Commit 97d155d

Browse files
soxofaanHansVRP
authored andcommitted
Add 502/503/504 to the default request retry list
refs: #835, #441
1 parent cdc3748 commit 97d155d

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
@@ -231,7 +231,13 @@ def add_backend(
231231
parallel_jobs: int = 2,
232232
):
233233
"""
234-
Register a backend with a name and a Connection getter.
234+
Register a backend with a name and a :py:class:`Connection` getter.
235+
236+
.. note::
237+
For optimal throughput and responsiveness, it is recommended
238+
to provide a :py:class:`Connection` instance without its own (blocking) retry behavior,
239+
since the job manager will do retries in a non-blocking way,
240+
allowing to take care of other tasks before retrying failed requests.
235241
236242
:param name:
237243
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)