Check open conn count before submitting new creation task

This commit is contained in:
Tyler Hobbs
2013-11-04 16:20:14 -06:00
parent a2ae4906a3
commit dd84464991

View File

@@ -322,6 +322,8 @@ class HostConnectionPool(object):
with self._lock:
if self._scheduled_for_creation >= _MAX_SIMULTANEOUS_CREATION:
return
if self.open_count >= self._session.cluster.get_max_connections_per_host(self.host_distance):
return
self._scheduled_for_creation += 1
log.debug("Submitting task for creation of new Connection to %s", self.host)