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: if self._worker is None and self._emit_notifications:
self._worker = futures.ThreadPoolExecutor(max_workers=1) self._worker = futures.ThreadPoolExecutor(max_workers=1)
self._client.ensure_path(self.path) self._client.ensure_path(self.path)
self._job_watcher = watchers.ChildrenWatch( if self._job_watcher is None:
self._client, self._job_watcher = watchers.ChildrenWatch(
self.path, self._client,
func=self._on_job_posting, self.path,
allow_session_lost=False) func=self._on_job_posting,
allow_session_lost=True)
except excp.IncompatibleVersion: except excp.IncompatibleVersion:
with excutils.save_and_reraise_exception(): with excutils.save_and_reraise_exception():
try_clean() try_clean()