mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Retry on raft internal error (#1241)
Fixes https://github.com/zalando/patroni/issues/1237
This commit is contained in:
+8
-3
@@ -25,6 +25,10 @@ from threading import Thread
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class EtcdRaftInternal(etcd.EtcdException):
|
||||
"""Raft Internal Error"""
|
||||
|
||||
|
||||
class EtcdError(DCSError):
|
||||
pass
|
||||
|
||||
@@ -312,9 +316,7 @@ class Etcd(AbstractDCS):
|
||||
super(Etcd, self).__init__(config)
|
||||
self._ttl = int(config.get('ttl') or 30)
|
||||
self._retry = Retry(deadline=config['retry_timeout'], max_delay=1, max_tries=-1,
|
||||
retry_exceptions=(etcd.EtcdLeaderElectionInProgress,
|
||||
etcd.EtcdWatcherCleared,
|
||||
etcd.EtcdEventIndexCleared))
|
||||
retry_exceptions=(etcd.EtcdLeaderElectionInProgress, EtcdRaftInternal))
|
||||
self._client = self.get_etcd_client(config)
|
||||
self.__do_not_watch = False
|
||||
self._has_failed = False
|
||||
@@ -596,3 +598,6 @@ class Etcd(AbstractDCS):
|
||||
return super(Etcd, self).watch(None, timeout)
|
||||
finally:
|
||||
self.event.clear()
|
||||
|
||||
|
||||
etcd.EtcdError.error_exceptions[300] = EtcdRaftInternal
|
||||
|
||||
Reference in New Issue
Block a user