Omer Frenkel has posted comments on this change. Change subject: core: change the retry to run failed HA VM frequency ......................................................................
Patch Set 14: (5 comments) .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AutoStartVmsRunner.java Line 37: Config.<Integer> getValue(ConfigValues.RetryToRunAutoStartVmIntervalInSeconds); Line 38: private static AutoStartVmsRunner instance = new AutoStartVmsRunner(); Line 39: Line 40: /** Pair of id of the VM to be rerun and the time when it should be rerun */ Line 41: private CopyOnWriteArraySet<RecordOfAutoStartVmToRestart> recordsOfAutoStartVmsToRestart; maybe make it a little shorter: HaVmsToRestartSet Line 42: Line 43: public static AutoStartVmsRunner getInstance() { Line 44: return instance; Line 45: } Line 83: // the VM reached WaitForLunch, so from now on this job is not responsible Line 84: // to auto start it, future failures will be detected by the monitoring Line 85: recordsToRemove.add(recordOfAutoStartVmToRestart); Line 86: } Line 87: else { no need to release the lock here? Line 88: logFailedAttemptToRestartHighlyAvailableVm(vmId); Line 89: Line 90: if (!recordOfAutoStartVmToRestart.scheduleNextTimeToRun(nextTimeOfRetryToRun)) { Line 91: // if we could not schedule the next time to run the VM, it means Line 149: new RunVmParams(vmId), Line 150: ExecutionHandler.createInternalJobContext(lock)).getSucceeded(); Line 151: } Line 152: Line 153: private static class RecordOfAutoStartVmToRestart { i think you can drop the "RecordOf" but up to you Line 154: /** The earliest date in Java */ Line 155: private static final Date MIN_DATE = DateTime.getMinValue(); Line 156: /** How many time to try to restart highly available VM that went down */ Line 157: private static final int MAXIMUM_NUM_OF_TRIES_TO_RESTART_HA_VM = Line 152: Line 153: private static class RecordOfAutoStartVmToRestart { Line 154: /** The earliest date in Java */ Line 155: private static final Date MIN_DATE = DateTime.getMinValue(); Line 156: /** How many time to try to restart highly available VM that went down */ times* Line 157: private static final int MAXIMUM_NUM_OF_TRIES_TO_RESTART_HA_VM = Line 158: Config.<Integer> getValue(ConfigValues.MaxNumOfTriesToRunFailedAutoStartVm); Line 159: Line 160: /** The next time we should try to run the VM */ Line 177: this.timeToRunTheVm = timeToRunTheVm; Line 178: return ++numOfRuns < MAXIMUM_NUM_OF_TRIES_TO_RESTART_HA_VM; Line 179: } Line 180: Line 181: boolean isTimeToRun(Date now) { if its always now, why get it as param? Line 182: return timeToRunTheVm == MIN_DATE || now.compareTo(timeToRunTheVm) >= 0; Line 183: } Line 184: Line 185: Guid getVmId() { -- To view, visit http://gerrit.ovirt.org/19500 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f8914efc73ac1ea4f4a2ec4e588d778e9002451 Gerrit-PatchSet: 14 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com> Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Michal Skrivanek <michal.skriva...@redhat.com> Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com> Gerrit-Reviewer: Roy Golan <rgo...@redhat.com> 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