-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
(#2195) Added timeout to registry download call #2228
(#2195) Added timeout to registry download call #2228
Conversation
The testing part looks awful I think (mock the |
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.
This looks good to me! I think there's not much value in testing this relative to the difficulty of making a test where the network hangs forever.
In the future, we may want to make this timeout configurable, even if it's just via an environment variable. While 10s is a totally reasonable maximum value for most places, it might not be great if you are both far away and have a bad connection. We'll see how this shakes out for now.
I'll kick off the remaining tests, this is approved assuming they pass.
@beckjake good point! I was thinking about using a global config or something which should be used here but (maybe I'm wrong) there is nothing available in |
Global constants are always nice, though I felt this was unambiguous enough to just leave it. I agree it'd be quite tough to get it through from a config file given the current state of |
I'd be comfortable with adding a For the purposes of this PR, it would be great if we could apply this env var override in the scope of downloading data from the package hub |
Done |
I'll move the environ variable usage inside |
resolves #2195 (potentially)
Description
Added a 10 seconds timeout to every download call during
dbt deps
. I think the timeout is only for waiting until the response will be started to emmiting (the download process may be longer than timeout). See requests - Timeouts for more info.Checklist
CHANGELOG.md
and added information about my change to the "dbt next" section.