huizhilu commented on a change in pull request #1812:
URL: https://github.com/apache/helix/pull/1812#discussion_r669000607
##########
File path:
helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixManager.java
##########
@@ -1317,6 +1318,13 @@ public void handleNewSession(String sessionId) throws
Exception {
LOG.info("Handle new session, instance: {}, type: {}, session id: {}.",
_instanceName,
_instanceType, sessionId);
+ // Will only create live instance
+ if (LiveInstance.LiveInstanceStatus.PAUSED
Review comment:
Thanks, @xyuanlu, for the review.
This is another coding way to avoid potential NPE. If the variable is null,
`variable.equals()` could cause NPE. Then we have to check `if (variable !=
null && variable.equals())`. Here, using `PAUSED.equals()` helps simplify the
code.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]