Merge branch '4.19' of https://github.com/apache/cloudstack into 4.20

This commit is contained in:
Pearl Dsilva 2025-04-13 23:15:05 -04:00
commit 4ac8861f5e

View File

@ -1101,12 +1101,24 @@ public class ClusterManagerImpl extends ManagerBase implements ClusterManager, C
} }
if (_mshostId != null) { if (_mshostId != null) {
final ManagementServerHostVO mshost = _mshostDao.findByMsid(_msId); ManagementServerHostVO mshost = _mshostDao.findByMsid(_msId);
final ManagementServerStatusVO mshostStatus = mshostStatusDao.findByMsId(mshost.getUuid()); if (mshost != null) {
mshost.setState(ManagementServerHost.State.Down); ManagementServerStatusVO mshostStatus = mshostStatusDao.findByMsId(mshost.getUuid());
mshostStatus.setLastJvmStop(new Date()); if (mshostStatus != null) {
_mshostDao.update(_mshostId, mshost); mshost.setState(ManagementServerHost.State.Down);
mshostStatusDao.update(mshostStatus.getId(), mshostStatus); mshostStatus.setLastJvmStop(new Date());
_mshostDao.update(_mshostId, mshost);
mshostStatusDao.update(mshostStatus.getId(), mshostStatus);
} else {
s_logger.warn(String.format("Found a management server host [%s] without a status. This should never happen!", mshost));
mshostStatus = new ManagementServerStatusVO();
mshostStatus.setMsId(mshost.getUuid());
mshostStatus.setLastSystemBoot(new Date());
mshostStatus.setLastJvmStart(new Date());
mshostStatus.setUpdated(new Date());
mshostStatusDao.persist(mshostStatus);
}
}
} }
_heartbeatScheduler.shutdownNow(); _heartbeatScheduler.shutdownNow();