Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Add configurable timeout to ET requests. #99

Merged
merged 1 commit into from
Jul 31, 2014

Conversation

pmclanahan
Copy link

@jgmize I think this will help too. Should keep basket from churning forever.
I'd still like to check into catching this particular timeout and catching it
with statsd or something.

security = Security()
token = UsernameToken(inst.user, inst.pass_)
security.tokens.append(token)
inst.client.set_options(wsse=security)
inst.client = Client(WSDL_URL, wsse=security, timeout=ET_TIMEOUT)
Copy link

Choose a reason for hiding this comment

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

While this looks good in theory, I can't find where setting the timeout here actually does something in https://github.com/mozilla/basket-lib/blob/master/packages/suds/suds/client.py other than just storing the key value pair in the Client.options dict. What am I missing?

Copy link
Author

Choose a reason for hiding this comment

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

I had to dive deep. It eventually passes it to urllib2 I believe.

Copy link
Author

Choose a reason for hiding this comment

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

Copy link

Choose a reason for hiding this comment

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

Right, but Client.options aren't being passed during the HttpAuthenticated instantiation; they are separate dicts.

Copy link
Author

Choose a reason for hiding this comment

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

Hmm... maybe you're right. Could set the default timeout via the socket module. Not sure if it'd be overridden. Another option might be to look into upgrading suds. Not sure. Good catch though. I really thought I'd traced it all the way back :(

@pmclanahan
Copy link
Author

I believe this one will work.

jgmize added a commit that referenced this pull request Jul 31, 2014
Add configurable timeout to ET requests.
@jgmize jgmize merged commit 7e0fd5d into mozilla:master Jul 31, 2014
@jgmize
Copy link

jgmize commented Jul 31, 2014

I believe it will, too :)

@pmclanahan pmclanahan deleted the add-et-timeout branch July 31, 2014 14:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants