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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]