-
Notifications
You must be signed in to change notification settings - Fork 184
add default timeout on requests #148
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
Conversation
|
@Chovin - Thanks so much for the contribution here! I think you're on the right track here with adding this timeout (requests documentation). I also think making this configurable for the developer (a config entry for this SDK) is also a good idea so folks can override that if needed. For the error handling ... if we're not doing any catching/modifying, I would just pass that back as-is. Since we're not doing that now (defaults to hanging), I wouldn't consider that a breaking change. Also from the docs:
It looks like all errors are caught and wrapped in an https://github.com/auth0/auth0-python/blob/master/auth0/v3/authentication/base.py#L37 ... so I would stick with that standard. I'm curious, though, why a |
|
@joshcanhelp thanks so much for the feedback! I'll take a look at making it configurable. I couldn't find where this is done currently, but I'll keep looking. I may need to ask for some more help if I'm not able to find it if that's alright 😁 as for the error, I'm pretty sure it doesn't get wrapped into an for the mock request, it was asserting that post was called with the old list of parameters. It was complaining that now there was a new parameter, |
No problem at all 😄 appreciate the effort here. I'll see if I can get some guidance on that for you.
Looks like you're right and, in that case, I think it's ok to not just wrap this one. If it's all part of the same set of errors then I think that's OK to pass right through for handling. Right now it just fails "silently" so I don't see this as breaking. |
|
A few more things to go on here ... the constructor that needs to accept this (with a default fallback) is here: https://github.com/auth0/auth0-python/blob/master/auth0/v3/management/rest.py#L16 Developers who want to customize it would need to manually require that particular “entity” file e.g. doing https://github.com/auth0/auth0-python/blob/master/auth0/v3/management/auth0.py#L21 Hope that helps! |
|
@Chovin - I still think this would be great to have in this SDK. Do you need anymore guidance here? |
|
This needs to be merged, we hit the same problem in production where the thread just hanged. |
|
Superceeded by #209 |
to avoid hanging indefinitely as brought up by #82
I chose 30 seconds because of this comment on the
requestsrepo.I'd like to try my hand at contributing to auth0 but I'm not quite sure where to go from here in regards to this PR.
On the timeout value,
On the error thrown when timing out,
Any feedback would be greatly appreciated!