From 1050bae6a8360c11b6c728ebd90f18d98d69bdad Mon Sep 17 00:00:00 2001
From: John Chilton <jmchilton@gmail.com>
Date: Tue, 30 Aug 2016 14:33:38 -0400
Subject: [PATCH] Avoid loop when preprocessing fails and polling enabled.

Tweak to behavior added here https://github.com/galaxyproject/pulsar/commit/8242741ba15e5b753fbd7f2845156552071adfa0. Don't postprocess the failed job, just indicate the proxy status as failed and be done with it.
---
 pulsar/managers/stateful.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pulsar/managers/stateful.py b/pulsar/managers/stateful.py
index 1f33a2a3..1ced1689 100644
--- a/pulsar/managers/stateful.py
+++ b/pulsar/managers/stateful.py
@@ -113,7 +113,8 @@ class StatefulManagerProxy(ManagerProxy):
         """
         state_change = None
         if job_directory.has_metadata(JOB_FILE_PREPROCESSING_FAILED):
-            proxy_status = status.COMPLETE
+            proxy_status = status.FAILED
+            job_directory.store_metadata(JOB_FILE_FINAL_STATUS, proxy_status)
             state_change = "to_complete"
         elif not job_directory.has_metadata(JOB_FILE_PREPROCESSED):
             proxy_status = status.PREPROCESSING
-- 
GitLab