Skip to content

Commit 5f458da

Browse files
committed
Make database heartbeat more robust
Should fix #21713
1 parent e881bba commit 5f458da

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/galaxy/model/database_heartbeat.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
)
1212

1313
from galaxy.model import WorkerProcess
14+
from galaxy.model.base import check_database_connection
1415
from galaxy.model.orm.now import now
1516

1617
log = logging.getLogger(__name__)
@@ -106,7 +107,11 @@ def update_watcher_designation(self):
106107
def send_database_heartbeat(self):
107108
if self.active:
108109
while not self.exit.is_set():
109-
self.update_watcher_designation()
110+
check_database_connection(self.sa_session)
111+
try:
112+
self.update_watcher_designation()
113+
except Exception:
114+
log.exception("Error sending database heartbeat for server '%s'", self.server_name)
110115
self.exit.wait(self.heartbeat_interval)
111116

112117
def _delete_worker_process(self):

0 commit comments

Comments
 (0)