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

Extend HTTP timeout #803

Merged
merged 9 commits into from
May 20, 2024
Merged

Extend HTTP timeout #803

merged 9 commits into from
May 20, 2024

Conversation

joshtemple
Copy link
Collaborator

@joshtemple joshtemple commented May 10, 2024

Change description

We were not backing off and retrying on manifest changes, which was by design since often the manifest is not there and we don't want to retry a 404. However, we can still retry timeouts, so I've added backoff for that endpoint for timeouts but not status errors.

We were not backing off and retrying on httpx.ReadError, so I've used the parent class NetworkError to catch this in our backoff logic.

We were only retrying most requests 3 times by default. With exponential backoff, this isn't waiting that long in total. I've increased the number of retries to 10 for any network error or 502 status. I've ensured we give up immediately and don't retry on status error that isn't a 502.

Type of change

  • Bug fix (fixes an issue)
  • New feature (adds functionality)

Related issues

Checklists

Security

  • Security impact of change has been considered
  • Code follows security best practices and guidelines

Code review

  • Pull request has a descriptive title and context useful to a reviewer

@joshtemple joshtemple changed the title Josh/extend http timeout Extend HTTP timeout May 10, 2024
Copy link
Collaborator

@DylanBaker DylanBaker left a comment

Choose a reason for hiding this comment

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

@joshtemple doesn't this get over-ridden by the timeout on each request?

@joshtemple
Copy link
Collaborator Author

Yes, and I'm still not sure why I'm seeing a 5 sec ReadTimeout in the logs. Thoughts on merging the backoff change for TimeoutException on the manifest call but removing the timeout changes?

@DylanBaker
Copy link
Collaborator

Yeah, I'm good with that.

Extends retries to all httpx.NetworkError (which will include ReadError) and increases the number of retries in the case of network errors while giving up for all non-502 status errors
@joshtemple joshtemple force-pushed the josh/extend-http-timeout branch from 9358a64 to 1972cff Compare May 16, 2024 19:55
@joshtemple joshtemple requested a review from DylanBaker May 16, 2024 19:56
@joshtemple joshtemple merged commit ef62546 into master May 20, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants