Merge "Retry Coordinator start indefinitely"
This commit is contained in:
commit
7a8869ae92
|
@ -17,6 +17,7 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import math
|
import math
|
||||||
|
import time
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
@ -79,13 +80,18 @@ class CoordinationMixin(object):
|
||||||
super(CoordinationMixin, self).start()
|
super(CoordinationMixin, self).start()
|
||||||
|
|
||||||
if self._coordinator is not None:
|
if self._coordinator is not None:
|
||||||
|
while not self._coordination_started:
|
||||||
|
try:
|
||||||
self._coordinator.start()
|
self._coordinator.start()
|
||||||
|
|
||||||
self._coordinator.create_group(self.service_name)
|
self._coordinator.create_group(self.service_name)
|
||||||
self._coordinator.join_group(self.service_name)
|
self._coordinator.join_group(self.service_name)
|
||||||
|
|
||||||
self._coordination_started = True
|
self._coordination_started = True
|
||||||
|
|
||||||
|
except Exception:
|
||||||
|
LOG.warn(_LW("Failed to start Coordinator:"),
|
||||||
|
exc_info=True)
|
||||||
|
time.sleep(15)
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
if self._coordinator is not None:
|
if self._coordinator is not None:
|
||||||
self._coordination_started = False
|
self._coordination_started = False
|
||||||
|
|
Loading…
Reference in New Issue