Disable the etcd timeout on watch calls to prevent them from disconnecting the client.
This commit is contained in:
parent
b2d7fad667
commit
2ed9b3d243
1 changed files with 3 additions and 1 deletions
|
@ -21,6 +21,7 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
ETCD_BUILDER_PREFIX = 'building/'
|
ETCD_BUILDER_PREFIX = 'building/'
|
||||||
ETCD_EXPIRE_RESULT = 'expire'
|
ETCD_EXPIRE_RESULT = 'expire'
|
||||||
|
ETCD_DISABLE_TIMEOUT = 0
|
||||||
|
|
||||||
|
|
||||||
class EphemeralBuilderManager(BaseManager):
|
class EphemeralBuilderManager(BaseManager):
|
||||||
|
@ -52,7 +53,8 @@ class EphemeralBuilderManager(BaseManager):
|
||||||
""" Watch the builders key for expirations.
|
""" Watch the builders key for expirations.
|
||||||
"""
|
"""
|
||||||
if not self._shutting_down:
|
if not self._shutting_down:
|
||||||
workers_future = self._etcd_client.watch(ETCD_BUILDER_PREFIX, recursive=True)
|
workers_future = self._etcd_client.watch(ETCD_BUILDER_PREFIX, recursive=True,
|
||||||
|
timeout=ETCD_DISABLE_TIMEOUT)
|
||||||
workers_future.add_done_callback(self._handle_key_expiration)
|
workers_future.add_done_callback(self._handle_key_expiration)
|
||||||
logger.debug('Scheduling watch task.')
|
logger.debug('Scheduling watch task.')
|
||||||
self._worker_watch_task = async(workers_future)
|
self._worker_watch_task = async(workers_future)
|
||||||
|
|
Reference in a new issue