Martin Peřina has posted comments on this change. Change subject: [RFE] Add periodic power management health check.. ......................................................................
Patch Set 1: (3 comments) http://gerrit.ovirt.org/#/c/27367/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/Backend.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/Backend.java: Line 244: 1, quotaCacheIntervalInMinutes, TimeUnit.MINUTES); Line 245: //initializes attestation Line 246: initAttestation(); Line 247: // Initialize Power Management Health Check Line 248: PmHealthCheckManager.getInstance().initialize(); Hmm, I thought we initialize all server processes in InitBackendServicesOnStartupBean. Is there any reason why we have initialization spread over two places? Line 249: } Line 250: Line 251: private void initAttestation() { Line 252: List<VDSGroup> vdsGroups = DbFacade.getInstance().getVdsGroupDao().getTrustedClusters(); http://gerrit.ovirt.org/#/c/27367/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/pm/PmHealthCheckManager.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/pm/PmHealthCheckManager.java: Line 54: public void pmHealthCheck() { Line 55: // skip PM health check if previous operation is not complete yet Line 56: if (!inWork) { Line 57: synchronized (instance) { Line 58: List<VDS> hosts = DbFacade.getInstance().getVdsDao().getAll(); Shouldn't "inWork=true" be place here? Btw, Quartz has its own mechanism not to overlap job execution: StatefullJob should be used instead of Job to achieve this. Line 59: for (VDS host : hosts) { Line 60: if (host.getpm_enabled()) { Line 61: boolean hasSecondary = (host.getPmSecondaryIp() != null && !host.getPmSecondaryIp().isEmpty()); Line 62: boolean isConcurrent = host.isPmSecondaryConcurrent(); Line 76: addAlarm(host.getId(), isConcurrent, AuditLogType.VDS_ALERT_PM_HEALTH_CHECK_FAILED_FOR_CON_PRIMARY_AGENT, AuditLogType.VDS_ALERT_PM_HEALTH_CHECK_FAILED_FOR_SEQ_PRIMARY_AGENT); Line 77: } Line 78: } Line 79: } Line 80: inWork=false; Wouldn't it be safer to put execution block into try block and set "inWork=false" in finally part? Line 81: } Line 82: } Line 83: } Line 84: -- To view, visit http://gerrit.ovirt.org/27367 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib1dfeab92a35793ebb421db8e3be94587dfe85e2 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Eli Mesika <emes...@redhat.com> Gerrit-Reviewer: Eli Mesika <emes...@redhat.com> Gerrit-Reviewer: Martin Peřina <mper...@redhat.com> Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches