You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "pdolif (via GitHub)" <gi...@apache.org> on 2025/07/27 13:45:19 UTC

[PR] [fix][broker] Fix NPE being logged if load manager class name is blank [pulsar]

pdolif opened a new pull request, #24570:
URL: https://github.com/apache/pulsar/pull/24570

   Fixes #24568
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   ### Does this pull request potentially affect one of the following parts:
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   *If the box was checked, please highlight the changes*
   
   - [ ] Dependencies (add or upgrade a dependency)
   - [ ] The public API
   - [ ] The schema
   - [ ] The default values of configurations
   - [ ] The threading model
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [ ] The metrics
   - [ ] Anything that affects deployment
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: https://github.com/pdolif/pulsar/pull/12


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


Re: [PR] [fix][broker] Fix NPE being logged if load manager class name is blank [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #24570:
URL: https://github.com/apache/pulsar/pull/24570#discussion_r2235215202


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/LoadManager.java:
##########
@@ -152,8 +153,14 @@ default void writeLoadReportOnZookeeper(boolean force) throws Exception {
     static LoadManager create(final PulsarService pulsar) {
         try {
             final ServiceConfiguration conf = pulsar.getConfiguration();
+
+            String loadManagerClassName = conf.getLoadManagerClassName();
+            if (StringUtils.isBlank(loadManagerClassName)) {
+                loadManagerClassName = SimpleLoadManagerImpl.class.getName();

Review Comment:
   I guess the reason for SimpleLoadManagerImpl is that on line 182, it defaults to SimpleLoadManagerImpl. Perhaps we should change the default to ModularLoadManagerImpl to make it consistent with broker.conf / ServiceConfiguration defaults?



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


Re: [PR] [fix][broker] Fix NPE being logged if load manager class name is blank [pulsar]

Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- merged PR #24570:
URL: https://github.com/apache/pulsar/pull/24570


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


Re: [PR] [fix][broker] Fix NPE being logged if load manager class name is blank [pulsar]

Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- commented on PR #24570:
URL: https://github.com/apache/pulsar/pull/24570#issuecomment-3141969230

   /pulsarbot run-failure-checks


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


Re: [PR] [fix][broker] Fix NPE being logged if load manager class name is blank [pulsar]

Posted by "nodece (via GitHub)" <gi...@apache.org>.
nodece commented on code in PR #24570:
URL: https://github.com/apache/pulsar/pull/24570#discussion_r2234955898


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/LoadManager.java:
##########
@@ -152,8 +153,14 @@ default void writeLoadReportOnZookeeper(boolean force) throws Exception {
     static LoadManager create(final PulsarService pulsar) {
         try {
             final ServiceConfiguration conf = pulsar.getConfiguration();
+
+            String loadManagerClassName = conf.getLoadManagerClassName();
+            if (StringUtils.isBlank(loadManagerClassName)) {
+                loadManagerClassName = SimpleLoadManagerImpl.class.getName();

Review Comment:
   ```
   private String loadManagerClassName = "org.apache.pulsar.broker.loadbalance.impl.ModularLoadManagerImpl";
   ```
   
   Do you consider this value?



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


Re: [PR] [fix][broker] Fix NPE being logged if load manager class name is blank [pulsar]

Posted by "pdolif (via GitHub)" <gi...@apache.org>.
pdolif commented on code in PR #24570:
URL: https://github.com/apache/pulsar/pull/24570#discussion_r2237347671


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/LoadManager.java:
##########
@@ -152,8 +153,14 @@ default void writeLoadReportOnZookeeper(boolean force) throws Exception {
     static LoadManager create(final PulsarService pulsar) {
         try {
             final ServiceConfiguration conf = pulsar.getConfiguration();
+
+            String loadManagerClassName = conf.getLoadManagerClassName();
+            if (StringUtils.isBlank(loadManagerClassName)) {
+                loadManagerClassName = SimpleLoadManagerImpl.class.getName();

Review Comment:
   Yes, that's the reason. I did not want to change the current behaviour.



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