From 9557b1a85b69327470d51cc842ec7862f10e14c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Wed, 16 Jul 2025 22:17:32 +0200 Subject: [PATCH 1/4] Silence error when terminating jobs --- executorlib/task_scheduler/file/queue_spawner.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/executorlib/task_scheduler/file/queue_spawner.py b/executorlib/task_scheduler/file/queue_spawner.py index 7060dd6a..8c34561f 100644 --- a/executorlib/task_scheduler/file/queue_spawner.py +++ b/executorlib/task_scheduler/file/queue_spawner.py @@ -110,8 +110,10 @@ def terminate_with_pysqa( ) status = qa.get_status_of_job(process_id=queue_id) if status is not None and status not in ["finished", "error"]: - qa.delete_job(process_id=queue_id) - + try: + qa.delete_job(process_id=queue_id) + except subprocess.CalledProcessError: + pass def _pysqa_execute_command( commands: str, From cf65cf013041c0055251d9f38fc4d3774d908bc9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 16 Jul 2025 20:31:50 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- executorlib/task_scheduler/file/queue_spawner.py | 1 + 1 file changed, 1 insertion(+) diff --git a/executorlib/task_scheduler/file/queue_spawner.py b/executorlib/task_scheduler/file/queue_spawner.py index 8c34561f..dfd19e0e 100644 --- a/executorlib/task_scheduler/file/queue_spawner.py +++ b/executorlib/task_scheduler/file/queue_spawner.py @@ -115,6 +115,7 @@ def terminate_with_pysqa( except subprocess.CalledProcessError: pass + def _pysqa_execute_command( commands: str, working_directory: Optional[str] = None, From 9718c826f43dcde3ef4ab3a9d77fd61005379fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Wed, 16 Jul 2025 22:33:55 +0200 Subject: [PATCH 3/4] use contextlib --- executorlib/task_scheduler/file/queue_spawner.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/executorlib/task_scheduler/file/queue_spawner.py b/executorlib/task_scheduler/file/queue_spawner.py index 8c34561f..2ec1400e 100644 --- a/executorlib/task_scheduler/file/queue_spawner.py +++ b/executorlib/task_scheduler/file/queue_spawner.py @@ -1,3 +1,4 @@ +import contextlib import os import subprocess from typing import Optional, Union @@ -110,10 +111,9 @@ def terminate_with_pysqa( ) status = qa.get_status_of_job(process_id=queue_id) if status is not None and status not in ["finished", "error"]: - try: + with contextlib.suppress(subprocess.CalledProcessError): qa.delete_job(process_id=queue_id) - except subprocess.CalledProcessError: - pass + def _pysqa_execute_command( commands: str, From 830a32ce02edede4ac9e4ccace23b4cd395f0c11 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 16 Jul 2025 20:34:25 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- executorlib/task_scheduler/file/queue_spawner.py | 1 - 1 file changed, 1 deletion(-) diff --git a/executorlib/task_scheduler/file/queue_spawner.py b/executorlib/task_scheduler/file/queue_spawner.py index 290585a3..2ec1400e 100644 --- a/executorlib/task_scheduler/file/queue_spawner.py +++ b/executorlib/task_scheduler/file/queue_spawner.py @@ -115,7 +115,6 @@ def terminate_with_pysqa( qa.delete_job(process_id=queue_id) - def _pysqa_execute_command( commands: str, working_directory: Optional[str] = None,