Merge "Retry Coordinator start indefinitely"

This commit is contained in:
Jenkins 2016-01-14 15:19:09 +00:00 committed by Gerrit Code Review
commit 7a8869ae92
2 changed files with 12 additions and 6 deletions

View File

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