From 036d4fafbd21e0e53c678e610a1200d6284e9439 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 10 May 2024 07:00:18 +0200 Subject: [PATCH] Don't log exception if cancelled slurm job doesn't have stderr file This seems entirely expected and not worth reporting at an ERROR level. Fixes https://sentry.galaxyproject.org/share/issue/c7332e0cf1554c33b2cf56283acfcd1d/: ``` FileNotFoundError [Errno 2] No such file or directory: '/corral4/main/jobs/057/797/57797989/galaxy_57797989.e' ``` --- lib/galaxy/jobs/runners/slurm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/galaxy/jobs/runners/slurm.py b/lib/galaxy/jobs/runners/slurm.py index 2c0ab4af6b5..98c373d9664 100644 --- a/lib/galaxy/jobs/runners/slurm.py +++ b/lib/galaxy/jobs/runners/slurm.py @@ -222,6 +222,9 @@ class SlurmJobRunner(DRMAAJobRunner): return OUT_OF_MEMORY_MSG elif any(_ in stripped_line for _ in SLURM_MEMORY_LIMIT_EXCEEDED_PARTIAL_WARNINGS): return PROBABLY_OUT_OF_MEMORY_MSG + except FileNotFoundError: + # Entirely expected, as __check_memory_limit is only called if the job state is CANCELLED + return False except Exception: log.exception("Error reading end of %s:", efile_path)