You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/04/22 04:23:28 UTC

[GitHub] [kafka] wenbingshen opened a new pull request #10586: KAFKA-12702: Fix NPE in networkListeners from BrokerServer in 2.8

wenbingshen opened a new pull request #10586:
URL: https://github.com/apache/kafka/pull/10586


   Link to [KAFKA-12702](https://issues.apache.org/jira/browse/KAFKA-12702) , [10575](https://github.com/apache/kafka/pull/10575)
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


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

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



[GitHub] [kafka] chia7712 merged pull request #10586: KAFKA-12702: Fix NPE in networkListeners from BrokerServer in 2.8

Posted by GitBox <gi...@apache.org>.
chia7712 merged pull request #10586:
URL: https://github.com/apache/kafka/pull/10586


   


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

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



[GitHub] [kafka] wenbingshen commented on pull request #10586: KAFKA-12702: Fix NPE in networkListeners from BrokerServer in 2.8

Posted by GitBox <gi...@apache.org>.
wenbingshen commented on pull request #10586:
URL: https://github.com/apache/kafka/pull/10586#issuecomment-824529067


   Dear @chia7712 , I request apply this pr to the 2.8 branch.


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

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



[GitHub] [kafka] chia7712 commented on pull request #10586: KAFKA-12702: Fix NPE in networkListeners from BrokerServer in 2.8

Posted by GitBox <gi...@apache.org>.
chia7712 commented on pull request #10586:
URL: https://github.com/apache/kafka/pull/10586#issuecomment-826324896


   @wenbingshen thanks for this backport!


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

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



[GitHub] [kafka] chia7712 commented on pull request #10586: KAFKA-12702: Fix NPE in networkListeners from BrokerServer in 2.8

Posted by GitBox <gi...@apache.org>.
chia7712 commented on pull request #10586:
URL: https://github.com/apache/kafka/pull/10586#issuecomment-826324896


   @wenbingshen thanks for this backport!


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

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



[GitHub] [kafka] chia7712 commented on a change in pull request #10586: KAFKA-12702: Fix NPE in networkListeners from BrokerServer in 2.8

Posted by GitBox <gi...@apache.org>.
chia7712 commented on a change in pull request #10586:
URL: https://github.com/apache/kafka/pull/10586#discussion_r618107415



##########
File path: core/src/main/scala/kafka/server/BrokerServer.scala
##########
@@ -272,7 +273,7 @@ class BrokerServer(
       val networkListeners = new ListenerCollection()
       config.advertisedListeners.foreach { ep =>
         networkListeners.add(new Listener().
-          setHost(ep.host).
+          setHost(if (Utils.isBlank(ep.host)) InetAddress.getLocalHost.getCanonicalHostName else ep.host).

Review comment:
       I feel it is ok to check blank manually. It won't bring huge code conflicts.




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

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



[GitHub] [kafka] chia7712 merged pull request #10586: KAFKA-12702: Fix NPE in networkListeners from BrokerServer in 2.8

Posted by GitBox <gi...@apache.org>.
chia7712 merged pull request #10586:
URL: https://github.com/apache/kafka/pull/10586


   


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

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



[GitHub] [kafka] wenbingshen commented on a change in pull request #10586: KAFKA-12702: Fix NPE in networkListeners from BrokerServer in 2.8

Posted by GitBox <gi...@apache.org>.
wenbingshen commented on a change in pull request #10586:
URL: https://github.com/apache/kafka/pull/10586#discussion_r618111371



##########
File path: core/src/main/scala/kafka/server/BrokerServer.scala
##########
@@ -272,7 +273,7 @@ class BrokerServer(
       val networkListeners = new ListenerCollection()
       config.advertisedListeners.foreach { ep =>
         networkListeners.add(new Listener().
-          setHost(ep.host).
+          setHost(if (Utils.isBlank(ep.host)) InetAddress.getLocalHost.getCanonicalHostName else ep.host).

Review comment:
       > I feel it is ok to check blank manually. It won't bring huge code conflicts.
   
   Good suggestion.Submit your feedback. :)




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

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