diff options
author | Joshua Harlow <harlowja@gmail.com> | 2015-02-16 09:49:26 -0800 |
---|---|---|
committer | Joshua Harlow <harlowja@gmail.com> | 2015-02-16 09:50:24 -0800 |
commit | 35f07aac34be07aabd5733101c74aacdc47db9c3 (patch) | |
tree | 7dae709d9d60c2294ef0b4a8f9fa4102ed3b28ef | |
parent | a3f126f0e66fd5cf98db52e6ce7a03de1c4ccd3e (diff) | |
download | taskflow-35f07aac34be07aabd5733101c74aacdc47db9c3.tar.gz |
Allow turning off the version check
Since the version check appears to be somewhat
flakey allow it to be turned off by power users
who know they are running the correct zookeeper
version (and therefore can avoid this flakey
check in the first place).
Change-Id: Ia5323454aac543d3241e322144928d1076558d93
-rw-r--r-- | taskflow/jobs/backends/impl_zookeeper.py | 3 | ||||
-rw-r--r-- | taskflow/persistence/backends/impl_zookeeper.py | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/taskflow/jobs/backends/impl_zookeeper.py b/taskflow/jobs/backends/impl_zookeeper.py index 3e52f65..87ccac6 100644 --- a/taskflow/jobs/backends/impl_zookeeper.py +++ b/taskflow/jobs/backends/impl_zookeeper.py @@ -720,7 +720,8 @@ class ZookeeperJobBoard(base.NotifyingJobBoard): k_exceptions.KazooException) as e: raise excp.JobFailure("Failed to connect to zookeeper", e) try: - kazoo_utils.check_compatible(self._client, MIN_ZK_VERSION) + if self._conf.get('check_compatible', True): + kazoo_utils.check_compatible(self._client, MIN_ZK_VERSION) if self._worker is None and self._emit_notifications: self._worker = futures.ThreadPoolExecutor(max_workers=1) self._client.ensure_path(self.path) diff --git a/taskflow/persistence/backends/impl_zookeeper.py b/taskflow/persistence/backends/impl_zookeeper.py index 916a889..ae8096f 100644 --- a/taskflow/persistence/backends/impl_zookeeper.py +++ b/taskflow/persistence/backends/impl_zookeeper.py @@ -71,7 +71,7 @@ class ZkBackend(base.Backend): return self._path def get_connection(self): - conn = ZkConnection(self, self._client) + conn = ZkConnection(self, self._client, self._conf) if not self._validated: conn.validate() self._validated = True @@ -88,9 +88,10 @@ class ZkBackend(base.Backend): class ZkConnection(base.Connection): - def __init__(self, backend, client): + def __init__(self, backend, client, conf): self._backend = backend self._client = client + self._conf = conf self._book_path = paths.join(self._backend.path, "books") self._flow_path = paths.join(self._backend.path, "flow_details") self._atom_path = paths.join(self._backend.path, "atom_details") @@ -101,7 +102,8 @@ class ZkConnection(base.Connection): def validate(self): with self._exc_wrapper(): try: - k_utils.check_compatible(self._client, MIN_ZK_VERSION) + if self._conf.get('check_compatible', True): + k_utils.check_compatible(self._client, MIN_ZK_VERSION) except exc.IncompatibleVersion as e: raise exc.StorageFailure("Backend storage is not a" " compatible version", e) |