From 81e9a910633d63c6db23f042f3b8230e7aa63ac1 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 5 Apr 2024 12:13:07 +0200 Subject: [PATCH] Always discard session after __handle_waiting_jobs is done --- lib/galaxy/jobs/handler.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/jobs/handler.py b/lib/galaxy/jobs/handler.py index 008a4eee0be4..1df3503ffb96 100644 --- a/lib/galaxy/jobs/handler.py +++ b/lib/galaxy/jobs/handler.py @@ -395,6 +395,8 @@ def __monitor_step(self): self.__handle_waiting_jobs() except StopSignalException: pass + finally: + self.sa_session.remove() log.trace(monitor_step_timer.to_str()) def __handle_waiting_jobs(self): @@ -583,9 +585,6 @@ def __handle_waiting_jobs(self): with transaction(self.sa_session): self.sa_session.commit() - # Done with the session - self.sa_session.remove() - def __filter_jobs_with_invalid_input_states(self, jobs): """ Takes list of jobs and filters out jobs whose input datasets are in invalid state and