Merge branch '1.x'

This commit is contained in:
Tyler Hobbs
2014-05-21 16:35:01 -05:00
2 changed files with 7 additions and 1 deletions

View File

@@ -22,6 +22,9 @@ Bug Fixes
* Pass WriteType instance to RetryPolicy.on_write_timeout() instead
of the string name of the write type. This caused write timeout
errors to always be rethrown instead of retrying. (github #123)
* Avoid submitting tasks to the ThreadPoolExecutor after shutdown. With
retries enabled, this could cause Cluster.shutdown() to hang under
some circumstances.
Other
^^^^^

View File

@@ -130,6 +130,8 @@ def run_in_executor(f):
@wraps(f)
def new_f(self, *args, **kwargs):
if self.is_shutdown:
return
try:
future = self.executor.submit(f, self, *args, **kwargs)
future.add_done_callback(_future_completed)
@@ -1366,7 +1368,8 @@ class Session(object):
def submit(self, fn, *args, **kwargs):
""" Internal """
return self.cluster.executor.submit(fn, *args, **kwargs)
if not self.is_shutdown:
return self.cluster.executor.submit(fn, *args, **kwargs)
def get_pool_state(self):
return dict((host, pool.get_state()) for host, pool in self._pools.items())