Skip to content

Commit

Permalink
Merge pull request #17085 from mvdbeek/always_commit_no_rollback
Browse files Browse the repository at this point in the history
[23.1] Remove rollback from ``__check_jobs_at_startup``
  • Loading branch information
mvdbeek authored Nov 27, 2023
2 parents 41b302d + da387d4 commit 5a1f3f9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/galaxy/jobs/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,13 @@ def __check_jobs_at_startup(self):
In case the activation is enforced it will filter out the jobs of inactive users.
"""
stmt = self._build_check_jobs_at_startup_statement()
with self.sa_session() as session, session.begin():
try:
for job in session.scalars(stmt):
with session.begin_nested():
self._check_job_at_startup(job)
finally:
with self.sa_session() as session:
for job in session.scalars(stmt):
try:
self._check_job_at_startup(job)
except Exception:
log.exception("Error while recovering job %s during application startup.", job.id)
with transaction(session):
session.commit()

def _check_job_at_startup(self, job):
Expand Down

0 comments on commit 5a1f3f9

Please sign in to comment.