-
Notifications
You must be signed in to change notification settings - Fork 608
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
Conversation
There was a problem hiding this 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!
The documentation is not available anymore as the PR was closed or merged. |
src/huggingface_hub/file_download.py
Outdated
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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and documentation
Let's merge it :) |
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 intransformers
'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))