File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -123,9 +123,11 @@ GitLab server can sometimes return a transient HTTP error.
123123python-gitlab can automatically retry in such case, when
124124``retry_transient_errors `` argument is set to ``True ``. When enabled,
125125HTTP 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
Original file line number Diff line number Diff line change @@ -780,7 +780,10 @@ def http_request(
780780 return result
781781
782782 if (429 == result .status_code and obey_rate_limit ) or (
783- result .status_code in gitlab .const .RETRYABLE_TRANSIENT_ERROR_CODES
783+ (
784+ result .status_code in gitlab .const .RETRYABLE_TRANSIENT_ERROR_CODES
785+ or (result .status_code == 409 and "Resource lock" in result .reason )
786+ )
784787 and retry_transient_errors
785788 ):
786789 # Response headers documentation:
You can’t perform that action at this time.
0 commit comments