Skip to content

Commit 6ed8b20

Browse files
author
Kelven Yang
committed
add catch-all clause in cluster heartbeat
1 parent 6544820 commit 6ed8b20

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

server/src/com/cloud/cluster/ClusterManagerImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ public Boolean propagateAgentEvent(long agentId, Event event) throws AgentUnavai
149149

150150
@Override
151151
public void broadcast(long agentId, Command[] cmds) {
152-
List<ManagementServerHostVO> peers = _mshostDao.getActiveList(new Date());
152+
Date cutTime = DateUtil.currentGMTTime();
153+
154+
List<ManagementServerHostVO> peers = _mshostDao.getActiveList(new Date(cutTime.getTime() - heartbeatThreshold));
153155
for (ManagementServerHostVO peer : peers) {
154156
String peerName = Long.toString(peer.getMsid());
155157
if (getSelfPeerName().equals(peerName)) {
@@ -516,7 +518,7 @@ public void run() {
516518

517519
_mshostDao.update(_mshostId, DateUtil.currentGMTTime());
518520
peerScan();
519-
} catch (Exception e) {
521+
} catch (Throwable e) {
520522
s_logger.error("Problem with the cluster heartbeat!", e);
521523
}
522524
}

0 commit comments

Comments
 (0)