Arik Hadas 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;
Done
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 because the RunVmCommand will release the lock anyway (in successful and 
failure flows)
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 {
Done
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 */
Done
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) {
the name was confusing, it is basically the time when the iteration started. in 
the worst case we'll wait 1 sec (the default frequency of the job) for the next 
time we'll try to run the VM
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 <[email protected]>
Gerrit-Reviewer: Arik Hadas <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to