Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfdb1d2c

Browse files
committed
feat(client): automatically retry on HTTP 409 Resource lock
Fixes:#2325
1 parentbcc1eb4 commitfdb1d2c

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

‎docs/api-usage-advanced.rst‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,11 @@ GitLab server can sometimes return a transient HTTP error.
123123
python-gitlab can automatically retry in such case, when
124124
``retry_transient_errors`` argument is set to ``True``. When enabled,
125125
HTTP error codes 500 (Internal Server Error), 502 (502 Bad Gateway),
126-
503 (Service Unavailable), and 504 (Gateway Timeout) are retried. It will retry until reaching
127-
the ``max_retries`` value. By default, ``retry_transient_errors`` is set to ``False`` and an exception
128-
is raised for these errors.
126+
503 (Service Unavailable), and 504 (Gateway Timeout) are retried.
127+
Additionally the HTTP error code 409 (Conflict) is retried if the text message
128+
mentions "Resource lock". It will retry until reaching the ``max_retries``
129+
value. By default, ``retry_transient_errors`` is set to ``False`` and an
130+
exception is raised for these errors.
129131

130132
..code-block::python
131133

‎gitlab/client.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,10 @@ def http_request(
764764
returnresult
765765

766766
if (429==result.status_codeandobey_rate_limit)or (
767-
result.status_codeinRETRYABLE_TRANSIENT_ERROR_CODES
767+
(
768+
result.status_codeinRETRYABLE_TRANSIENT_ERROR_CODES
769+
or (result.status_code==409and"Resource lock"inresult.reason)
770+
)
768771
andretry_transient_errors
769772
):
770773
# Response headers documentation:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp