From 83fce375f1f6caab5c57f232d2e56c815ef9853c Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Mon, 13 Oct 2014 14:37:18 -0600 Subject: [PATCH] On SSH connection loss, mark jobs as 'dead' Signed-off-by: Zack Cerza --- teuthology/run_tasks.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/teuthology/run_tasks.py b/teuthology/run_tasks.py index eaf59f9261..fd379fe559 100644 --- a/teuthology/run_tasks.py +++ b/teuthology/run_tasks.py @@ -3,6 +3,7 @@ import logging 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__) @@ -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.') @@ -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) -- 2.39.5