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 30s timeout on downloads (instead of 10s) #1514

Merged
merged 2 commits into from
Jun 19, 2023

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Jun 16, 2023

Related to internal slack thread. The default timeout when downloading a file (hf_hub_download) is 10s. This is far enough in most cases but in a very few cases it causes a ConnectionError (especially in transformers's CI recently). Except if this 10s limit is really useful, I suggest to remove it. In the worst case, there is a 60s timeout on cloudfront.

Note: I am not talking about the 10s etag_timeout that is used when making the HEAD call to the file. For this one I think it's good to keep it and default early (10s) to the local cache.

Thanks @ydshieh @rtrompier for debugging this one! I hope it'll solve transformers's issues :)

@julien-c @Pierrci @LysandreJik since it's about the /resolve/ endpoint, please let me know your opinion on this one 🙏

EDIT: reverted to 30s in 8e16055 (see #1514 (comment))

@Wauplin Wauplin requested review from julien-c, ydshieh and Pierrci June 16, 2023 14:13
Copy link
Contributor

@ydshieh ydshieh left a comment

Choose a reason for hiding this comment

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

Thanks! You saved transformers CI!

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jun 16, 2023

The documentation is not available anymore as the PR was closed or merged.

How many seconds to wait for the server to send data before
giving up which is passed to `requests.request`.
giving up which is passed to `requests.request`. Defaults to no timeouts.
Copy link
Member

Choose a reason for hiding this comment

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

hmm there's still a timeout no? just controlled by the server...

I would default to 30s maybe

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cloudfront is defaulting at 60s. I can update the docstring.

Copy link
Member

Choose a reason for hiding this comment

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

i don't see the drawback of having a value on the client side honestly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, let's put 30s then. I don't see a good reason to put a value either but I'm fine with it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted to 30s timeout in 8e16055

Copy link
Member

Choose a reason for hiding this comment

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

code determinism if/when the server config changes

Copy link
Member

Choose a reason for hiding this comment

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

and documentation

@Wauplin Wauplin changed the title Remove 10s timeout on downloads Set 30s timeout on downloads (instead of 10s) Jun 16, 2023
@ydshieh
Copy link
Contributor

ydshieh commented Jun 19, 2023

@Wauplin Let's try to merge this PR as soon as possible (i.e. maybe DM @Pierrci or pin @julien-c ) 🙏
With a lot of run failing like in the screenshot, it gets motivation down to check any failure on CI ...

Thank you 🙏

Screenshot 2023-06-19 083711

@Wauplin
Copy link
Contributor Author

Wauplin commented Jun 19, 2023

Let's merge it :)

@Wauplin Wauplin merged commit 92028da into main Jun 19, 2023
@Wauplin Wauplin deleted the no-timeout-when-downloading branch June 19, 2023 06:45
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.

4 participants