You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/12/14 14:37:44 UTC

[GitHub] [pulsar] mgrenonville opened a new pull request #13298: [11646][Pulsar Java client] Fix ConfigurationDataUtils loadConf strategy

mgrenonville opened a new pull request #13298:
URL: https://github.com/apache/pulsar/pull/13298


   Fixes https://github.com/apache/pulsar/issues/11646
   
   ### Motivation
   When using `loadConf`, ConfigurationDataUtils was loading existing values
   in a Map using Jackson mapper. If there is a `@JsonIgnore`, Jackson
   ignores theses fields, but there will be forgotten in the new instance.
   
   
   ### Modifications
   Using `readerForUpdating(existingData).readValue(configJson)` will
   refresh only overriden values in config map.
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   This change is already covered by existing tests, such as *org.apache.pulsar.client.impl.conf.ConfigurationDataUtilsTest*.
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API: no
     - The schema: no
     - The default values of configurations: no
     - The wire protocol: no
     - The rest endpoints: no
     - The admin cli options: no
     - Anything that affects deployment: no (at least, it will no longer fails silently on `@JsonIgnore` properties)
   
   ### Documentation
   
   Check the box below and label this PR (if you have committer privilege).
   
   Need to update docs? 
   
   - [x] `no-need-doc` 
   This was a bug in `loadConf` code, it is intended to work as follow (I think)  
   
   
   
   


-- 
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-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] mgrenonville commented on pull request #13298: [11646][Pulsar Java client] Fix ConfigurationDataUtils loadConf strategy

Posted by GitBox <gi...@apache.org>.
mgrenonville commented on pull request #13298:
URL: https://github.com/apache/pulsar/pull/13298#issuecomment-1006063163


   Hi @codelipenghui !


-- 
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-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] codelipenghui commented on a change in pull request #13298: [11646][Pulsar Java client] Fix ConfigurationDataUtils loadConf strategy

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on a change in pull request #13298:
URL: https://github.com/apache/pulsar/pull/13298#discussion_r786433149



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ConsumerConfigurationData.java
##########
@@ -134,6 +131,7 @@ public int getMaxPendingChuckedMessage() {
 
     private RegexSubscriptionMode regexSubscriptionMode = RegexSubscriptionMode.PersistentOnly;
 
+    @JsonIgnore

Review comment:
       Will this introduce breaking change?




-- 
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-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] gaoran10 commented on pull request #13298: [11646][Pulsar Java client] Fix ConfigurationDataUtils loadConf strategy

Posted by GitBox <gi...@apache.org>.
gaoran10 commented on pull request #13298:
URL: https://github.com/apache/pulsar/pull/13298#issuecomment-1008335611


   Maybe we could add a construct method for `DeadLetterPolicy`, then we could the conf to set `DeadLetterPolicy`.


-- 
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-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] michaeljmarshall commented on a change in pull request #13298: [11646][Pulsar Java client] Fix ConfigurationDataUtils loadConf strategy

Posted by GitBox <gi...@apache.org>.
michaeljmarshall commented on a change in pull request #13298:
URL: https://github.com/apache/pulsar/pull/13298#discussion_r805032447



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ConfigurationDataUtils.java
##########
@@ -51,20 +51,17 @@ public static ObjectMapper getThreadLocal() {
         return mapper.get();
     }
 
-    private ConfigurationDataUtils() {}
+    private ConfigurationDataUtils() {
+    }
 
     public static <T> T loadData(Map<String, Object> config,
-                                 T existingData,
-                                 Class<T> dataCls) {
+                                 T existingData) {

Review comment:
       Unless I'm mistaken, I believe this is part of the public API and could be used by user applications to build the `ClientConfigurationData`. We would need to find a way to introduce this without breaking the API.




-- 
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-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] mgrenonville edited a comment on pull request #13298: [11646][Pulsar Java client] Fix ConfigurationDataUtils loadConf strategy

Posted by GitBox <gi...@apache.org>.
mgrenonville edited a comment on pull request #13298:
URL: https://github.com/apache/pulsar/pull/13298#issuecomment-1006063163


   Hi @codelipenghui !
   It's strange, I see that CI test are failing however, when executing these tests  on my computer, they work. Are they known to be flaky ?


-- 
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-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] gaoran10 edited a comment on pull request #13298: [11646][Pulsar Java client] Fix ConfigurationDataUtils loadConf strategy

Posted by GitBox <gi...@apache.org>.
gaoran10 edited a comment on pull request #13298:
URL: https://github.com/apache/pulsar/pull/13298#issuecomment-1008335611


   Maybe we could add a construct method for `DeadLetterPolicy`, then we could use the conf to set `DeadLetterPolicy`.


-- 
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-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] mgrenonville commented on a change in pull request #13298: [11646][Pulsar Java client] Fix ConfigurationDataUtils loadConf strategy

Posted by GitBox <gi...@apache.org>.
mgrenonville commented on a change in pull request #13298:
URL: https://github.com/apache/pulsar/pull/13298#discussion_r770361655



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ConfigurationDataUtils.java
##########
@@ -51,20 +51,18 @@ public static ObjectMapper getThreadLocal() {
         return mapper.get();
     }
 
-    private ConfigurationDataUtils() {}
+    private ConfigurationDataUtils() {
+    }
 
     public static <T> T loadData(Map<String, Object> config,
                                  T existingData,
                                  Class<T> dataCls) {

Review comment:
       Thanks for review !
   You're right, I've done the update.




-- 
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-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] codelipenghui commented on a change in pull request #13298: [11646][Pulsar Java client] Fix ConfigurationDataUtils loadConf strategy

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on a change in pull request #13298:
URL: https://github.com/apache/pulsar/pull/13298#discussion_r769336408



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ConfigurationDataUtils.java
##########
@@ -51,20 +51,18 @@ public static ObjectMapper getThreadLocal() {
         return mapper.get();
     }
 
-    private ConfigurationDataUtils() {}
+    private ConfigurationDataUtils() {
+    }
 
     public static <T> T loadData(Map<String, Object> config,
                                  T existingData,
                                  Class<T> dataCls) {

Review comment:
       The `dataCls` becomes useless after the new change, we should remove it.




-- 
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-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] github-actions[bot] commented on pull request #13298: [11646][Pulsar Java client] Fix ConfigurationDataUtils loadConf strategy

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #13298:
URL: https://github.com/apache/pulsar/pull/13298#issuecomment-1072917114


   The pr had no activity for 30 days, mark with Stale label.


-- 
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-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] codelipenghui commented on pull request #13298: [11646][Pulsar Java client] Fix ConfigurationDataUtils loadConf strategy

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on pull request #13298:
URL: https://github.com/apache/pulsar/pull/13298#issuecomment-1007145128


   @mgrenonville You can left a comment with content `/pulsarbot run-failure-checks` to trigger to rerun the failed tests.


-- 
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-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] Jason918 commented on a change in pull request #13298: [11646][Pulsar Java client] Fix ConfigurationDataUtils loadConf strategy

Posted by GitBox <gi...@apache.org>.
Jason918 commented on a change in pull request #13298:
URL: https://github.com/apache/pulsar/pull/13298#discussion_r805112391



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ConsumerConfigurationData.java
##########
@@ -149,12 +147,13 @@ public int getMaxPendingChuckedMessage() {
 
     private boolean resetIncludeHead = false;
 
+    @JsonIgnore

Review comment:
       Can you add some details about why we add `@JsonIgnore ` here? 

##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ConfigurationDataUtils.java
##########
@@ -51,20 +51,17 @@ public static ObjectMapper getThreadLocal() {
         return mapper.get();
     }
 
-    private ConfigurationDataUtils() {}
+    private ConfigurationDataUtils() {
+    }
 
     public static <T> T loadData(Map<String, Object> config,
-                                 T existingData,
-                                 Class<T> dataCls) {
+                                 T existingData) {

Review comment:
       +1. We can keep the old method and just mark deprecated.




-- 
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-unsubscribe@pulsar.apache.org

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