Skip to content
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

New ConnectionPool class. #277

Closed
wants to merge 5 commits into from
Closed

New ConnectionPool class. #277

wants to merge 5 commits into from

Conversation

bwbeach
Copy link
Contributor

@bwbeach bwbeach commented Jul 25, 2011

This is a reimplementation of the connection pool. It discards connections when they haven't been used for 60 seconds, to avoid getting timeouts from AWS.

We've been running this code on our servers for the past week, and most of our connection errors have gone away, although we're still seeing an occasional 400 response code with the error "Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.". I haven't been able to reproduce this error, even when sleeping long enough to induce a timeout.

I have been seeing problems where AWS would time out a connection
right before it was pulled from the connection pool, and then a
variety of errors can happen, some of which boto catches, and some of
which it doesn't.  The biggest problem, though, was that it sometimes
takes a long time to get those errors.

The connection pool will now discard connections that are 'stale',
meaning that they have been in the pool for too long.  The threshold
for staleness is currently set at 15 seconds.

The test_pool program now uses real threads, not greenlets.
The method is used by the test program, so it ought to be a public
method.
@garnaat
Copy link
Member

garnaat commented Jul 27, 2011

I have merged this change.

@garnaat garnaat closed this Jul 27, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants