From 9bae0a06a44e96d88d60a52a632a2f02c6263c64 Mon Sep 17 00:00:00 2001 From: John Davis Date: Tue, 16 Jan 2024 15:48:06 -0500 Subject: [PATCH 1/2] Check db connection for invalid transactions in runner's monitor loop --- lib/galaxy/jobs/runners/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/jobs/runners/__init__.py b/lib/galaxy/jobs/runners/__init__.py index c14aea726f03..1be761b9b9ce 100644 --- a/lib/galaxy/jobs/runners/__init__.py +++ b/lib/galaxy/jobs/runners/__init__.py @@ -33,7 +33,10 @@ job_script, write_script, ) -from galaxy.model.base import transaction +from galaxy.model.base import ( + check_database_connection, + transaction, +) from galaxy.tool_util.deps.dependencies import ( JobInfo, ToolInfo, @@ -829,6 +832,7 @@ def monitor(self): pass # Iterate over the list of watched jobs and check state try: + check_database_connection(self.sa_session) self.check_watched_items() except Exception: log.exception("Unhandled exception checking active jobs") From a4d0c33972908595345c84ecb6a566f748014f70 Mon Sep 17 00:00:00 2001 From: John Davis Date: Tue, 16 Jan 2024 15:54:20 -0500 Subject: [PATCH 2/2] Remove redundant db connection check --- lib/galaxy/jobs/runners/pulsar.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/galaxy/jobs/runners/pulsar.py b/lib/galaxy/jobs/runners/pulsar.py index 3925f4d8a7be..a554a4b54775 100644 --- a/lib/galaxy/jobs/runners/pulsar.py +++ b/lib/galaxy/jobs/runners/pulsar.py @@ -274,7 +274,6 @@ def url_to_destination(self, url): return JobDestination(runner="pulsar", params=url_to_destination_params(url)) def check_watched_item(self, job_state): - check_database_connection(self.app.model.session()) if self.use_mq: # Might still need to check pod IPs. job_wrapper = job_state.job_wrapper