NPE running systemready
@@ -111,6 +111,7 @@ public class SystemReadyMonitorImpl implements SystemReadyMonitor {
}
private void check() {
+ try {
CheckStatus.State prevState = getStatus(StateType.READY).getState();
List<SystemReadyCheck> currentChecks = new ArrayList<>(checks);
List<String> checkNames = currentChecks.stream().map(check -> check.getName()).collect(Collectors.toList());
@@ -122,6 +123,9 @@ public class SystemReadyMonitorImpl implements SystemReadyMonitor {
manageMarkerService(currState);
}
log.debug("Checks finished");
+ } catch (Exception e) {
+ log.warn("Exception when running checks", e);
+ }
}
private List<CheckStatus> evaluateAllChecks(List<SystemReadyCheck> currentChecks) {
@@ -136,7 +140,7 @@ public class SystemReadyMonitorImpl implements SystemReadyMonitor {
SystemReady readyService = new SystemReady() {
};
sreg = context.registerService(SystemReady.class, readyService, null);
- } else {
+ } else if (sreg != null) {
sreg.unregister();
}
}
