Skip to content

Commit

Permalink
Handle db api exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Apr 4, 2024
1 parent e970ae5 commit 72e9374
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/galaxy/jobs/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
Union,
)

from sqlalchemy.exc import OperationalError
from sqlalchemy.exc import (
DBAPIError,
OperationalError,
)
from sqlalchemy.sql.expression import (
and_,
func,
Expand Down Expand Up @@ -395,6 +398,10 @@ def __monitor_step(self):
self.__handle_waiting_jobs()
except StopSignalException:
pass
except DBAPIError as e:
log.exception(f"Execution of a database operation failed due to the following exception: {e}")
self.sa_session.remove()

log.trace(monitor_step_timer.to_str())

def __handle_waiting_jobs(self):
Expand Down

0 comments on commit 72e9374

Please sign in to comment.