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/08/13 09:09:31 UTC

[GitHub] [pulsar] BewareMyPower commented on a change in pull request #10961: Fix incorrect port of advertisedListener

BewareMyPower commented on a change in pull request #10961:
URL: https://github.com/apache/pulsar/pull/10961#discussion_r688364532



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
##########
@@ -1362,7 +1362,7 @@ public ShutdownService getShutdownService() {
 
     protected String brokerUrl(ServiceConfiguration config) {
         if (config.getBrokerServicePort().isPresent()) {
-            return brokerUrl(ServiceConfigurationUtils.getAppliedAdvertisedAddress(config),
+            return brokerUrl(ServiceConfigurationUtils.getAppliedAdvertisedAddress(config, true),

Review comment:
       Why is the second parameter true? This fix has changed the default behavior. See `getAppliedAdvertisedAddress`:
   
   ```diff
    -       if (advertisedListener != null) {
    +       if (advertisedListener != null && !ignoreAdvertisedListener) {
   ```
   
   Before this change, if `advertisedListener` is not null, it will go to this if block. However, after this change, it won't go to this if block because `!ignoreAdvertisedListener` is false. This may affect the Pulsar client's lookup result because `OwnershipCache#selfOwnerInfo` is set to the `PulsarService#brokerServiceUrl` in `OwnershipCache#refreshSelfOwnerInfo` method.




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