From b13f5d7f943106cf27670c7153e6c8967a749bcf Mon Sep 17 00:00:00 2001 From: E Rasche Date: Thu, 28 Sep 2017 08:07:55 +0000 Subject: [PATCH] Rebase script integrity check improvements (#4720) from dev --- .../jobs/runners/util/job_script/__init__.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/galaxy/jobs/runners/util/job_script/__init__.py b/lib/galaxy/jobs/runners/util/job_script/__init__.py index 2c717c8f13dc..20aae2fe86fe 100644 --- a/lib/galaxy/jobs/runners/util/job_script/__init__.py +++ b/lib/galaxy/jobs/runners/util/job_script/__init__.py @@ -1,3 +1,4 @@ +import logging import os import subprocess import time @@ -8,6 +9,7 @@ from galaxy.util import unicodify +log = logging.getLogger(__name__) DEFAULT_SHELL = '/bin/bash' DEFAULT_JOB_FILE_TEMPLATE = Template( @@ -124,6 +126,8 @@ def _handle_script_integrity(path, config): script_integrity_verified = True break + log.debug("Script integrity error: returncode was %d", returncode) + # Else we will sync and wait to see if the script becomes # executable. try: @@ -131,11 +135,13 @@ def _handle_script_integrity(path, config): # These have occurred both in Docker containers and on EC2 clusters # under high load. subprocess.check_call(INTEGRITY_SYNC_COMMAND) - except Exception: - pass - time.sleep(sleep_amt) - except Exception: - pass + except Exception as e: + log.debug("Error syncing the filesystem: %s", unicodify(e)) + + except Exception as exc: + log.debug("Script not available yet: %s", unicodify(exc)) + + time.sleep(sleep_amt) if not script_integrity_verified: raise Exception("Failed to write job script, could not verify job script integrity.")