Description
The Redfish Python library can raise RetriesExhaustedError even when the final permitted retry succeeds.
In our environment, the client is configured with:
The request sequence is:
Attempt 1 of /redfish/v1/
... connection failure: [Errno 113] No route to host ...
Attempt 2 of /redfish/v1/
Response Time for GET to /redfish/v1/: 0.108... seconds
Attempt 2 successfully receives a valid HTTP response.
However, immediately afterward the library raises:
redfish.rest.v1.RetriesExhaustedError
The relevant code is:
attempts = 0
restresp = None
while attempts <= max_retry:
attempts = attempts + 1
try:
resp = self._session.request(...)
restresp = RestResponse(restreq, resp)
except Exception as excp:
...
continue
else:
break
if attempts <= self._max_retry:
return restresp
else:
raise RetriesExhaustedError() from cause_exception
With max_retry=1, two total attempts are allowed:
Attempt 1 -> fails
Attempt 2 -> succeeds
After the successful second attempt:
attempts = 2
self._max_retry = 1
restresp = valid RestResponse
The following check therefore evaluates false:
if attempts <= self._max_retry:
and RetriesExhaustedError is raised despite the valid response.
Charm revision
latest/stable
Juju version
3.6.13
Cloud
No response
Expected behaviour
If any permitted retry succeeds, the returned RestResponse should be returned to the caller.
For example:
if restresp is not None:
return restresp
else:
raise RetriesExhaustedError() from cause_exception
Reproduce / Test
- Configure the Redfish client with max_retry=1.
- Make the first request fail with a transient connection error.
- Allow the second attempt to succeed.
- Observe that the library still raises RetriesExhaustedError instead of returning the successful response.
Notes & References
No response
Description
The Redfish Python library can raise
RetriesExhaustedErroreven when the final permitted retry succeeds.In our environment, the client is configured with:
The request sequence is:
However, immediately afterward the library raises:
The relevant code is:
With max_retry=1, two total attempts are allowed:
After the successful second attempt:
The following check therefore evaluates false:
and RetriesExhaustedError is raised despite the valid response.
Charm revision
latest/stable
Juju version
3.6.13
Cloud
No response
Expected behaviour
If any permitted retry succeeds, the returned
RestResponseshould be returned to the caller.For example:
Reproduce / Test
Notes & References
No response