From 9d7f998511ee37c61b43dfe54fb3c3a14f664fd0 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Wed, 27 Sep 2017 10:15:31 +0100 Subject: [PATCH] framework/instrumentation: handle non-job errors in ManagedCallback If an error occurs in a ManagedCallback that is invoked outside of a job, re-raise rather than attempting to update the status of the non-existent job. --- wa/framework/instrumentation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wa/framework/instrumentation.py b/wa/framework/instrumentation.py index b3ce49af..4df437b3 100644 --- a/wa/framework/instrumentation.py +++ b/wa/framework/instrumentation.py @@ -275,7 +275,10 @@ class ManagedCallback(object): if isinstance(e, WorkloadError): context.set_status('FAILED') else: - context.set_status('PARTIAL') + if context.current_job: + context.set_status('PARTIAL') + else: + raise # Need this to keep track of callbacks, because the dispatcher only keeps