[DRIVERS-2815] Add Retries to on our API Calls Created: 29/Jan/24  Updated: 07/Feb/24  Resolved: 05/Feb/24

Status: Closed
Project: Drivers
Component/s: Astrolabe
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Jib Adegunloye Assignee: Jib Adegunloye
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Driver Changes: Not Needed
Start date:

 Description   

Summary

Astrolabe tests fail intermittently. These failures can often be transient and a retry could absolve us of the error. Implement retry logic for our api calls.

Example Stacktrace:

 [2024/01/25 23:10:26.073] Traceback (most recent call last):
 [2024/01/25 23:10:26.073]   File "Z:\data\mci\887352df31b77292fa8f21d33afe9c8c\astrolabe-src\atlasclient\client.py", line 229, in request
 [2024/01/25 23:10:26.073]     response = requests.request(method, url, **request_kwargs)
 [2024/01/25 23:10:26.073]   File "Z:\data\mci\887352df31b77292fa8f21d33afe9c8c\astrolabe-src\astrolabevenv\lib\site-packages\requests\api.py", line 59, in request
 [2024/01/25 23:10:26.073]     return session.request(method=method, url=url, **kwargs)
 [2024/01/25 23:10:26.073]   File "Z:\data\mci\887352df31b77292fa8f21d33afe9c8c\astrolabe-src\astrolabevenv\lib\site-packages\requests\sessions.py", line 589, in request
 [2024/01/25 23:10:26.073]     resp = self.send(prep, **send_kwargs)
 [2024/01/25 23:10:26.073]   File "Z:\data\mci\887352df31b77292fa8f21d33afe9c8c\astrolabe-src\astrolabevenv\lib\site-packages\requests\sessions.py", line 703, in send
 [2024/01/25 23:10:26.073]     r = adapter.send(request, **kwargs)
 [2024/01/25 23:10:26.073]   File "Z:\data\mci\887352df31b77292fa8f21d33afe9c8c\astrolabe-src\astrolabevenv\lib\site-packages\requests\adapters.py", line 532, in send
 [2024/01/25 23:10:26.073]     raise ReadTimeout(e, request=request)
 [2024/01/25 23:10:26.073] requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='cloud-qa.mongodb.com', port=443): Read timed out. (read timeout=30.0) 

Motivation

Who is the affected end user?

Astrolabe maintainers

How does this affect the end user?

Are they blocked? Are they annoyed? Are they confused?

Reduces noisy signal

How likely is it that this problem or use case will occur?

Main path? Edge case?

Main path.

If the problem does occur, what are the consequences and how severe are they?

Minor annoyance at a log message? Performance concern? Outage/unavailability? Failover can't complete?

Is this issue urgent?

Does this ticket have a required timeline? What is it?

No

Is this ticket required by a downstream team?

Needed by e.g. Atlas, Shell, Compass?

No

Is this ticket only for tests?

Does this ticket have any functional impact, or is it just test improvements?

Yes

Acceptance Criteria

What specific requirements must be met to consider the design phase complete?

Add retry logic to wrap our API calls. 

 



 Comments   
Comment by Jib Adegunloye [ 07/Feb/24 ]

https://github.com/mongodb-labs/drivers-atlas-testing/pull/197

Comment by Jib Adegunloye [ 05/Feb/24 ]

https://github.com/mongodb-labs/drivers-atlas-testing/pull/196

 

Comment by Jib Adegunloye [ 05/Feb/24 ]

https://spruce.mongodb.com/version/65c1260f57e85a28e944d99a/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC

Generated at Thu Feb 08 08:26:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.