Skip to content

Commit

Permalink
On SSH connection loss, mark jobs as 'dead'
Browse files Browse the repository at this point in the history
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
  • Loading branch information
Zack Cerza committed Oct 13, 2014
1 parent 4d388a4 commit 83fce37
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions teuthology/run_tasks.py
Expand Up @@ -3,6 +3,7 @@
from .sentry import get_client as get_sentry_client
from .misc import get_http_log_path
from .config import config as teuth_config
from .exceptions import ConnectionLostError
from copy import deepcopy

log = logging.getLogger(__name__)
Expand Down Expand Up @@ -54,6 +55,9 @@ def run_tasks(tasks, ctx):
stack.append((taskname, manager))
except BaseException as e:
ctx.summary['success'] = False
if isinstance(e, ConnectionLostError):
# Prevent connection issues being flagged as failures
ctx.summary['status'] = 'dead'
if 'failure_reason' not in ctx.summary:
ctx.summary['failure_reason'] = str(e)
log.exception('Saw exception from tasks.')
Expand Down Expand Up @@ -113,6 +117,9 @@ def run_tasks(tasks, ctx):
suppress = manager.__exit__(*exc_info)
except Exception as e:
ctx.summary['success'] = False
if isinstance(e, ConnectionLostError):
# Prevent connection issues being flagged as failures
ctx.summary['status'] = 'dead'
if 'failure_reason' not in ctx.summary:
ctx.summary['failure_reason'] = str(e)
log.exception('Manager failed: %s', taskname)
Expand Down

0 comments on commit 83fce37

Please sign in to comment.