You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/09/09 08:03:02 UTC

[GitHub] [rocketmq] dongeforever opened a new issue, #5039: localHostName() get stuck when constructing the BrokerIdentity object

dongeforever opened a new issue, #5039:
URL: https://github.com/apache/rocketmq/issues/5039

   ```
   "main" #1 prio=5 os_prio=31 tid=0x00007ff911809000 nid=0x1603 runnable [0x000070000933d000]
      java.lang.Thread.State: RUNNABLE
   	at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
   	at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929)
   	at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1324)
   	at java.net.InetAddress.getLocalHost(InetAddress.java:1501)
   	- locked <0x00000006c00da5d0> (a java.lang.Object)
   	at org.apache.rocketmq.common.BrokerIdentity.localHostName(BrokerIdentity.java:104)
   	at org.apache.rocketmq.common.BrokerIdentity.<init>(BrokerIdentity.java:38)
   	at org.apache.rocketmq.broker.BrokerController.getBrokerIdentity(BrokerController.java:1998)
   	at org.apache.rocketmq.broker.BrokerController.doRegisterBrokerAll(BrokerController.java:1685)
   	at org.apache.rocketmq.broker.BrokerController.registerBrokerAll(BrokerController.java:1661)
   	- locked <0x00000006c0090950> (a org.apache.rocketmq.broker.BrokerController)
   	at org.apache.rocketmq.broker.BrokerController.start(BrokerController.java:1525)
   	at org.apache.rocketmq.test.base.IntegrationTestBase.createAndStartBroker(IntegrationTestBase.java:160)
   	at org.apache.rocketmq.test.base.IntegrationTestBase.createAndStartBroker(IntegrationTestBase.java:148)
   	at org.apache.rocketmq.test.base.BaseConf.<clinit>(BaseConf.java:86)
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
   	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
   	at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:250)
   	at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:260)
   	at org.junit.runners.BlockJUnit4ClassRunner$2.runReflectiveCall(BlockJUnit4ClassRunner.java:309)
   	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
   	at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:306)
   	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
   	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
   	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
   	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
   	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
   	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
   	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
   	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
   	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
   	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
   	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
   	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
   	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
   	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
   	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
   	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
   ```
   
   The BrokerIdentity is frequently constructed in many cases. It's not a good idea to initialize an instance of  InetAddress every time.


-- 
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: dev-unsubscribe@rocketmq.apache.org.apache.org

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


[GitHub] [rocketmq] nowinkeyy commented on issue #5039: localHostName() get stuck when constructing the BrokerIdentity object

Posted by GitBox <gi...@apache.org>.
nowinkeyy commented on issue #5039:
URL: https://github.com/apache/rocketmq/issues/5039#issuecomment-1247019117

   hi, can i hava a try? 😄 


-- 
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: dev-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] nowinkeyy commented on issue #5039: localHostName() get stuck when constructing the BrokerIdentity object

Posted by GitBox <gi...@apache.org>.
nowinkeyy commented on issue #5039:
URL: https://github.com/apache/rocketmq/issues/5039#issuecomment-1251890875

   > > hi, can i hava a try? 😄
   > 
   > Hi @nowinkeyy ,
   > 
   > Welcome to our community. Seems like you're trying to get started on RocketMQ. This issue has been fixed by others. How about helping us solve another small issue: #5122
   
   i am very glad to do it! 😃 thank you!


-- 
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: dev-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] duhenglucky closed issue #5039: localHostName() get stuck when constructing the BrokerIdentity object

Posted by GitBox <gi...@apache.org>.
duhenglucky closed issue #5039: localHostName() get stuck when constructing the BrokerIdentity object
URL: https://github.com/apache/rocketmq/issues/5039


-- 
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: dev-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] dongeforever commented on issue #5039: localHostName() get stuck when constructing the BrokerIdentity object

Posted by GitBox <gi...@apache.org>.
dongeforever commented on issue #5039:
URL: https://github.com/apache/rocketmq/issues/5039#issuecomment-1241645079

    https://stackoverflow.com/questions/33289695/inetaddress-getlocalhost-slow-to-run-30-seconds 
   Following this article could reduce the time. But the BrokerIdentity is constructed many times during the process, so it still causes the process to get stuck.
   


-- 
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: dev-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] tsunghanjacktsai commented on issue #5039: localHostName() get stuck when constructing the BrokerIdentity object

Posted by GitBox <gi...@apache.org>.
tsunghanjacktsai commented on issue #5039:
URL: https://github.com/apache/rocketmq/issues/5039#issuecomment-1251749227

   > hi, can i hava a try? 😄
   
   Hi @nowinkeyy ,
   
   Welcome to our community. Seems like you're trying to get started on RocketMQ. This issue has been fixed by others. How about helping us solve another small issue: https://github.com/apache/rocketmq/issues/5122


-- 
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: dev-unsubscribe@rocketmq.apache.org

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