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 2020/03/05 00:57:43 UTC

[GitHub] [helix] NealSun96 commented on a change in pull request #858: Add logs and throw exceptions in getInstanceById

NealSun96 commented on a change in pull request #858: Add logs and throw exceptions in getInstanceById
URL: https://github.com/apache/helix/pull/858#discussion_r388022752
 
 

 ##########
 File path: helix-core/src/main/java/org/apache/helix/util/InstanceValidationUtil.java
 ##########
 @@ -266,6 +269,9 @@ public static boolean isInstanceStable(HelixDataAccessor dataAccessor, String in
       IdealState idealState = dataAccessor.getProperty(keyBuilder.idealStates(idealStateName));
       if (idealState == null || !idealState.isEnabled() || !idealState.isValid()
           || TaskConstants.STATE_MODEL_NAME.equals(idealState.getStateModelDefRef())) {
+        _logger.warn(
+            "idealState is either null, not enabled, not valid, or has Task as stateModelDefRef. IdealState: {}",
+            instanceName);
 
 Review comment:
   While this block doesn't fail the code, it's triggered in situations where idealState is null or is invalid. Just like the logs I did in `InstanceServiceImpl.java`, I think it's a good idea to log these unusual situations for debug purposes. 

----------------------------------------------------------------
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