Skip to content

Commit 3123c30

Browse files
committed
BUG-ID: CS-19196: Relax HA work termination rule on exceptions. It could cause premature HA termination due to unhandled exceptions. Reviewed-By:Anthony
1 parent 5310e66 commit 3123c30

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎server/src/com/cloud/ha/HighAvailabilityManagerImpl.java‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -913,8 +913,14 @@ private void runWithContext() {
913913
work.setDateTaken(null);
914914
}
915915
} catch (Exception e) {
916-
s_logger.error("Terminating " + work, e);
917-
work.setStep(Step.Error);
916+
s_logger.warn("Encountered unhandled exception during HA process, reschedule retry", e);
917+
918+
long nextTime = (System.currentTimeMillis() >> 10) + _restartRetryInterval;
919+
920+
s_logger.info("Rescheduling " + work + " to try again at " + new Date(nextTime << 10));
921+
work.setTimeToTry(nextTime);
922+
work.setServerId(null);
923+
work.setDateTaken(null);
918924
}
919925
_haDao.update(work.getId(), work);
920926
} catch (final Throwable th) {

0 commit comments

Comments
 (0)