nodece commented on code in PR #20884:
URL: https://github.com/apache/pulsar/pull/20884#discussion_r1424829715


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:
##########
@@ -2514,22 +2514,26 @@ private void handleDynamicConfigurationUpdates() {
                                 return;
                             }
                             Field configField = configFieldWrapper.field;
-                            Object newValue = 
FieldParser.value(data.get(configKey), configField);
-                            if (configField != null) {
-                                Consumer listener = 
configRegisteredListeners.get(configKey);
-                                try {
-                                    Object existingValue = 
configField.get(pulsar.getConfiguration());
+                            Consumer listener = 
configRegisteredListeners.get(configKey);
+                            Object newValue = null;
+                            Object existingValue;
+
+                            try {
+                                if (configField != null) {
+                                    newValue = 
FieldParser.value(data.get(configKey), configField);
+                                    existingValue = 
configField.get(pulsar.getConfiguration());
                                     configField.set(pulsar.getConfiguration(), 
newValue);
-                                    log.info("Successfully updated 
configuration {}/{}", configKey,
-                                            data.get(configKey));
-                                    if (listener != null && 
!existingValue.equals(newValue)) {
-                                        listener.accept(newValue);
-                                    }
-                                } catch (Exception e) {
-                                    log.error("Failed to update config {}/{}", 
configKey, newValue);
+                                } else {
+                                    newValue = value;
+                                    existingValue = 
configFieldWrapper.customValue;

Review Comment:
   The `customValue` defaults to null, when the config has been changed, this 
value will be updated, see `configFieldWrapper.customValue = 
String.valueOf(newValue);`.



-- 
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: commits-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to