do not update app state in statestore after it has reached final state
private static final EnumSet<RMAppState> COMPLETED_APP_STATES =
EnumSet.of(RMAppState.FINISHED, RMAppState.FINISHING, RMAppState.FAILED,
RMAppState.KILLED, RMAppState.FINAL_SAVING, RMAppState.KILLING);
+ private static final EnumSet<RMAppState> FINAL_APP_STATES =
+ EnumSet.of(RMAppState.FINISHED, RMAppState.FAILED, RMAppState.KILLED);
private static final String STATE_CHANGE_MESSAGE =
"%s State change from %s to %s on event = %s";
private static final String RECOVERY_MESSAGE =
@@ -2598,9 +2600,11 @@ public void rmNodeHasUpdatedCryptoMaterial(NodeId nodeId) {
this.callerContext, this.applicationTimeouts, keyStore, keyStorePassword,
trustStore, trustStorePassword, cryptoMaterialVersion, certificateExpiration,
isAppRotatingCryptoMaterial.get(), -1L);
+ if(!FINAL_APP_STATES.contains(getState())){
rmContext.getStateStore().updateApplicationStateNoNotify(appNewState);
}
}
+ }
} finally {
this.writeLock.unlock();
}
@@ -2619,7 +2623,9 @@ public void resetCryptoRotationMetrics() {
this.callerContext, this.applicationTimeouts, keyStore, keyStorePassword,
trustStore, trustStorePassword, cryptoMaterialVersion, certificateExpiration,
isAppRotatingCryptoMaterial.get(), -1L);
+ if(!FINAL_APP_STATES.contains(getState())){
rmContext.getStateStore().updateApplicationStateNoNotify(appNewState);
+ }
} finally {
this.writeLock.unlock();
}
