szetszwo commented on code in PR #1004:
URL: https://github.com/apache/ratis/pull/1004#discussion_r1445141663
##########
ratis-common/src/main/java/org/apache/ratis/conf/ReconfigurationBase.java:
##########
@@ -171,11 +171,13 @@ private void singleReconfiguration(String property,
String newValue) throws Reco
property, newValue, properties.get(property));
}
final String effective = reconfigureProperty(property, newValue);
- LOG.info("{}: changed property {} to {} (effective {})", name, property,
newValue, effective);
- if (newValue != null) {
+ if (effective != null) {
properties.set(property, effective);
+ LOG.info("{}: changed property {} to {} (effective {})", name, property,
newValue, effective);
} else {
properties.unset(property);
+ throw new ReconfigurationException("Value is null.", property, null,
+ properties.get(property));
Review Comment:
It should not throw an exception; see the javadoc
https://github.com/apache/ratis/blob/c2dacbd013a96a8cfb23e60dc09373fe0e32a28c/ratis-common/src/main/java/org/apache/ratis/conf/Reconfigurable.java#L32
##########
ratis-common/src/main/java/org/apache/ratis/conf/ReconfigurationBase.java:
##########
@@ -171,11 +171,13 @@ private void singleReconfiguration(String property,
String newValue) throws Reco
property, newValue, properties.get(property));
}
final String effective = reconfigureProperty(property, newValue);
- LOG.info("{}: changed property {} to {} (effective {})", name, property,
newValue, effective);
Review Comment:
Let's don't move this line. It is useful for both cases.
--
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]