Handle read timeouts from etcd when watching a key.
This commit is contained in:
parent
29bd428817
commit
709e571b78
2 changed files with 19 additions and 1 deletions
|
@ -7,6 +7,7 @@ import os.path
|
|||
from datetime import datetime, timedelta
|
||||
from trollius import From, coroutine, Return, async
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from urllib3.exceptions import ReadTimeoutError
|
||||
|
||||
from buildman.manager.basemanager import BaseManager
|
||||
from buildman.manager.executor import PopenExecutor, EC2Executor
|
||||
|
@ -65,7 +66,11 @@ class EphemeralBuilderManager(BaseManager):
|
|||
# Due to lack of interest, tomorrow has been cancelled
|
||||
return
|
||||
|
||||
etcd_result = changed_key_future.result()
|
||||
try:
|
||||
etcd_result = changed_key_future.result()
|
||||
except ReadTimeoutError:
|
||||
return
|
||||
|
||||
if etcd_result.action == ETCD_EXPIRE_RESULT:
|
||||
# Handle the expiration
|
||||
logger.debug('Builder expired, clean up the old build node')
|
||||
|
|
Reference in a new issue