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