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

Stop abusing socket global timeouts. #2560

Merged
merged 1 commit into from Sep 2, 2014

Conversation

Projects
None yet
2 participants
@damz
Contributor

damz commented Aug 26, 2014

This is a fix for the long-standing #1935.

Now that boto requires Python 2.6+ (see #96cd2800b6db067e503ef499486adf50ee9ca928), we can rely on the timeout parameter of urllib.request.build_opener instead of hacking the global socket timeout.

We have ran into a lot of issues because of this on a gevent based application that integrates with S3 using instance credentials: when two S3 requests come at roughly the same time the the global socket timeout will be forever set to 1.0s because the way the global timeout is messed with is racy.

@danielgtaylor

This comment has been minimized.

Show comment
Hide comment
@danielgtaylor

danielgtaylor Sep 2, 2014

Member

From the docs:

Changed in version 2.6: timeout was added.

Member

danielgtaylor commented Sep 2, 2014

From the docs:

Changed in version 2.6: timeout was added.

@danielgtaylor danielgtaylor self-assigned this Sep 2, 2014

@danielgtaylor

This comment has been minimized.

Show comment
Hide comment
@danielgtaylor

danielgtaylor Sep 2, 2014

Member

Thanks for taking the time to fix this longstanding hack. I appreciate it! 👍

Member

danielgtaylor commented Sep 2, 2014

Thanks for taking the time to fix this longstanding hack. I appreciate it! 👍

danielgtaylor added a commit that referenced this pull request Sep 2, 2014

Merge pull request #2560 from damz/pr/global-timeout
Use urllib timeout param instead of hacking socket global timeout. Fixes #2560, #1935.

@danielgtaylor danielgtaylor merged commit c1dd1fb into boto:develop Sep 2, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@damz

This comment has been minimized.

Show comment
Hide comment
@damz

damz Sep 2, 2014

Contributor

Thanks, @danielgtaylor!

Contributor

damz commented Sep 2, 2014

Thanks, @danielgtaylor!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment