You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2019/10/22 19:37:47 UTC

[GitHub] [helix] jiajunwang commented on a change in pull request #523: Add a null check for StateModel in Participant reset logic

jiajunwang commented on a change in pull request #523: Add a null check for StateModel in Participant reset logic
URL: https://github.com/apache/helix/pull/523#discussion_r337681279
 
 

 ##########
 File path: helix-core/src/main/java/org/apache/helix/participant/HelixStateMachineEngine.java
 ##########
 @@ -155,11 +155,26 @@ public void reset() {
           for (String partitionKey : stateModelFactory.getPartitionSet(resourceName)) {
             logger.info("Resetting {}::{}", resourceName, partitionKey);
             StateModel stateModel = stateModelFactory.getStateModel(resourceName, partitionKey);
-            stateModel.reset();
-            String initialState = _stateModelParser.getInitialState(stateModel.getClass());
-            stateModel.updateState(initialState);
-            // TODO probably should update the state on ZK. Shi confirm what needs
-            // to be done here.
+            if (stateModel != null) {
+              stateModel.reset();
+              String initialState = _stateModelParser.getInitialState(stateModel.getClass());
+              stateModel.updateState(initialState);
+              // TODO probably should update the state on ZK. Shi confirm what needs
 
 Review comment:
   What is Shi?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org