You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2019/08/09 22:54:52 UTC

[GitHub] [incubator-pinot] siddharthteotia commented on a change in pull request #4494: Fix potential NPE from HelixDataAccessor

siddharthteotia commented on a change in pull request #4494: Fix potential NPE from HelixDataAccessor
URL: https://github.com/apache/incubator-pinot/pull/4494#discussion_r312670754
 
 

 ##########
 File path: pinot-common/src/main/java/org/apache/pinot/common/utils/ServiceStatus.java
 ##########
 @@ -385,8 +385,12 @@ public IdealStateAndCurrentStateMatchServiceStatusCallback(HelixManager helixMan
     protected CurrentState getState(String resourceName) {
       PropertyKey.Builder keyBuilder = _helixDataAccessor.keyBuilder();
       LiveInstance liveInstance = _helixDataAccessor.getProperty(keyBuilder.liveInstance(_instanceName));
-      String sessionId = liveInstance.getSessionId();
-      return _helixDataAccessor.getProperty(keyBuilder.currentState(_instanceName, sessionId, resourceName));
+      if (liveInstance == null) {
 
 Review comment:
   Would it be appropriate here to raise error (like Preconditions.checkArgument) if it is null?

----------------------------------------------------------------
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: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org