Skip to content

Commit

Permalink
0004581: Heartbeat job should catch exceptions from heartbeat listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Marzullo committed Oct 12, 2020
1 parent eec7e0f commit 44738c3
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -2906,10 +2906,16 @@ public void heartbeat(boolean force) {
if (listeners.size() > 0) {
Node me = engine.getNodeService().findIdentity();
if (me != null) {
List<IHeartbeatListener> successfulListeners = new ArrayList<IHeartbeatListener>();
for (IHeartbeatListener l : listeners) {
l.heartbeat(me);
try {
l.heartbeat(me);
successfulListeners.add(l);
} catch(Throwable e) {
log.error("Failed to execute IHeartbeatListener " + l.getClass().getSimpleName(), e);
}
}
updateLastHeartbeatTime(listeners);
updateLastHeartbeatTime(successfulListeners);
} else {
log.debug("Did not run the heartbeat process because the node has not been configured");
}
Expand Down

0 comments on commit 44738c3

Please sign in to comment.