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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to