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

Retry on TimeoutException, as we did in HTTP v1.9 #1114

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Drvi
Copy link
Collaborator

@Drvi Drvi commented Sep 27, 2023

In #1110 we switched isrecoverable(::Exception) to be opt-in instead of opt-out, and we tried to include the exceptions we historically retried in older versions of HTTP. We didn't include TimeoutExceptions in that PR, but given some of the connection timeouts we've encountered in production, I think we want to retry those as well.

What do others think?

In the future, ideally, we'd have more granular control over retries to make this a simple runtime switch.

test/client.jl Outdated
try
HTTP.pushlayer!(test_context_layer)
# 10.0.0.0 is non-routeable and will result in a connection timeout
HTTP.get("http://10.0.0.0", connect_timeout=1, retries=3, retry_delays=[0.1, 0.1, 0.1], test_context=test_context)
Copy link
Collaborator Author

@Drvi Drvi Sep 27, 2023

Choose a reason for hiding this comment

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

Hmm, this doesn't quite work in CI (edit: seems like macOS CI specifically)

@gustafsson
Copy link
Contributor

I've often seen retried requests succeed after initial timeouts. Including it by default as isrecoverable makes sense to me.

Making isrecoverable part of the public API and mentioning it in the docs around Request retry arguments would also make sense with or without this change.

Could retry_check provide such granular control when isrecoverable is false? What would a more simple runtime switch look like?

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