Merge "Allow the watcher to re-register if the session is lost"

This commit is contained in:
Jenkins
2014-05-08 01:45:09 +00:00
committed by Gerrit Code Review

View File

@@ -648,11 +648,12 @@ class ZookeeperJobBoard(jobboard.NotifyingJobBoard):
if self._worker is None and self._emit_notifications:
self._worker = futures.ThreadPoolExecutor(max_workers=1)
self._client.ensure_path(self.path)
self._job_watcher = watchers.ChildrenWatch(
self._client,
self.path,
func=self._on_job_posting,
allow_session_lost=False)
if self._job_watcher is None:
self._job_watcher = watchers.ChildrenWatch(
self._client,
self.path,
func=self._on_job_posting,
allow_session_lost=True)
except excp.IncompatibleVersion:
with excutils.save_and_reraise_exception():
try_clean()