Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dont respect retry_after_header #1171

Merged
merged 1 commit into from
Jun 18, 2024
Merged

Dont respect retry_after_header #1171

merged 1 commit into from
Jun 18, 2024

Conversation

Uxio0
Copy link
Member

@Uxio0 Uxio0 commented Jun 14, 2024

- Previously, if a `RetryAfter` header is set it will overwrite our retry policy
- We should be the ones deciding on the retry policy
- More info on https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
@Uxio0 Uxio0 requested a review from a team as a code owner June 14, 2024 13:54
@coveralls
Copy link

coveralls commented Jun 14, 2024

Pull Request Test Coverage Report for Build 9517297034

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 3 unchanged lines in 3 files lost coverage.
  • Overall coverage remained the same at 93.798%

Files with Coverage Reduction New Missed Lines %
gnosis/eth/ethereum_client.py 1 86.16%
gnosis/safe/tests/utils.py 1 60.0%
gnosis/safe/safe_tx.py 1 90.97%
Totals Coverage Status
Change from base Build 9515813602: 0.0%
Covered Lines: 8243
Relevant Lines: 8788

💛 - Coveralls

@@ -15,8 +15,7 @@ def prepare_http_session(
session = requests.Session()
retry_conf = (
requests.adapters.Retry(
total=retry_count,
backoff_factor=0.3,
total=retry_count, backoff_factor=0.3, respect_retry_after_header=False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, wouldn't the server know better when we should attempt to retry the connection?

What are the use cases that you are thinking of where this decision should be on the client side?

Copy link
Member Author

@Uxio0 Uxio0 Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the service knows better in some scenarios. But for example some services tell you to retry in one hour, for example, blocking the request forever, and I see that happening with some RPCs (that's why I proposed this PR)

@Uxio0 Uxio0 merged commit 8b1dc6c into main Jun 18, 2024
7 checks passed
@Uxio0 Uxio0 deleted the retry-header branch June 18, 2024 13:19
@github-actions github-actions bot locked and limited conversation to collaborators Jun 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants