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

set default timeout to 30 s for async client as well #2044

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Twey
Copy link

@Twey Twey commented Nov 20, 2023

This brings the behaviour of the async client in line with the sync client.

@seanmonstar
Copy link
Owner

I think this could break some people, if they typically have responses that stream longer than 30 seconds.

One reason the blocking client has a default and the async one doesn't is that it's much harder to add timeout blocking operations in general, whereas for async, you can wrap any future in something like tokio::time::timeout(fut, dur).

@Twey
Copy link
Author

Twey commented Nov 20, 2023

I feel like it's a little bit of a footgun to have subtly different behaviour here. If we expect users to use tokio::timeout maybe there shouldn't be a timeout option built in at all?

@seanmonstar
Copy link
Owner

I think adding a default is a possibility in a breaking change, which we'll have to do to upgrade hyper to 1.0 anyways.

I'll note that another example is curl, which doesn't set a default: https://curl.se/libcurl/c/CURLOPT_TIMEOUT.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants