Merge branch 'master' into 2.0

Conflicts:
	cassandra/pool.py
This commit is contained in:
Tyler Hobbs
2014-05-06 13:57:06 -05:00
2 changed files with 14 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ Bug Fixes
* Fix duplicate node-up handling, which could result in multiple reconnectors
being started as well as the executor threads becoming deadlocked, preventing
future node up or node down handling from being executed.
* Handle exhausted ReconnectionPolicy schedule correctly
Other
-----

View File

@@ -195,9 +195,20 @@ class _ReconnectionHandler(object):
try:
conn = self.try_reconnect()
except Exception as exc:
next_delay = next(self.schedule)
try:
next_delay = next(self.schedule)
except StopIteration:
# the schedule has been exhausted
next_delay = None
# call on_exception for logging purposes even if next_delay is None
if self.on_exception(exc, next_delay):
self.scheduler.schedule(next_delay, self.run)
if next_delay is None:
log.warn(
"Will not continue to retry reconnection attempts "
"due to an exhausted retry schedule")
else:
self.scheduler.schedule(next_delay, self.run)
else:
if not self._cancelled:
self.on_reconnection(conn)