Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix connection pooling bug: don't close before reading.

If the connection pool is full when a connection is returned, the
connection was being closed before the response body was read.  Now,
the close() method is not explicitly called in put_http_connection;
instead, the connection will be closed when the object is garbage
collected.
  • Loading branch information...
commit 20e0d5ca712d510f4483045dc716cd1b39289ed2 1 parent 8992f88
@bwbeach bwbeach authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 boto/connection.py
View
7 boto/connection.py
@@ -430,8 +430,11 @@ def put_http_connection(self, host, is_secure, connection):
try:
self._pool[self._cached_name(host, is_secure)].put_nowait(connection)
except Queue.Full:
- # gracefully fail in case of pool overflow
- connection.close()
+ # Don't close the connection here, because the caller of
+ # _mexe, which calls this, has not read the response body
+ # yet. We'll just let the connection object close itself
+ # when it is freed.
+ pass
def proxy_ssl(self):
host = '%s:%d' % (self.host, self.port)
Please sign in to comment.
Something went wrong with that request. Please try again.