You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/11/29 03:18:46 UTC

[GitHub] [dubbo] tang-bf opened a new issue, #11049: 想要通过SimpleApplicationEventMulticaster自定义线程池提高export 启动速度

tang-bf opened a new issue, #11049:
URL: https://github.com/apache/dubbo/issues/11049

   dubbo+spring启动耗时太久,分析发现项目中定义的dubbo service有很多,导致启动过程中SimpleApplicationEventMulticaster执行multicastEvent,循环处理ApplicationListeners时间比较久。所以打算使用线程池excute invokeListener。就会提示端口已被绑定。
   请问有什么方法可以加快启动速度吗?
   报错信息如下:
   Failed to initialize connector [Connector[HTTP/1.1-8787]]
   org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-8787]]
           at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
           at org.apache.catalina.core.StandardService.initInternal(StandardService.java:567)
           at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
           at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:842)
           at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
           at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
           at org.apache.catalina.startup.Tomcat.start(Tomcat.java:340)
           at com.alibaba.dubbo.remoting.http.tomcat.TomcatHttpServer.<init>(TomcatHttpServer.java:85)
           at com.alibaba.dubbo.remoting.http.tomcat.TomcatHttpBinder.bind(TomcatHttpBinder.java:29)
           at com.alibaba.dubbo.remoting.http.HttpBinder$Adpative.bind(HttpBinder$Adpative.java)
           at com.alibaba.dubbo.rpc.protocol.rest.DubboHttpServer.doStart(DubboHttpServer.java:54)
           at com.alibaba.dubbo.rpc.protocol.rest.BaseRestServer.start(BaseRestServer.java:48)
           at com.alibaba.dubbo.rpc.protocol.rest.RestProtocol.doExport(RestProtocol.java:89)
           at com.alibaba.dubbo.rpc.protocol.AbstractProxyProtocol.export(AbstractProxyProtocol.java:69)
           at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:55)
           at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:56)
           at com.alibaba.dubbo.rpc.Protocol$Adpative.export(Protocol$Adpative.java)
           at com.alibaba.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:495)
           at com.alibaba.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:285)
           at com.alibaba.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:246)
           at com.alibaba.dubbo.config.ServiceConfig.export(ServiceConfig.java:145)
           at com.alibaba.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:110)
           at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
           at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
           at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:134)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
           at java.lang.Thread.run(Thread.java:748)
   Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed
           at org.apache.catalina.connector.Connector.initInternal(Connector.java:962)
           at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
           ... 27 more
   Caused by: java.net.BindException: Address already in use: bind
           at sun.nio.ch.Net.bind0(Native Method)
           at sun.nio.ch.Net.bind(Net.java:438)
           at sun.nio.ch.Net.bind(Net.java:430)
           at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:225)
           at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
           at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:343)
           at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:730)
           at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:456)
           at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:120)
           at org.apache.catalina.connector.Connector.initInternal(Connector.java:960)
           ... 28 more


-- 
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: notifications-unsubscribe@dubbo.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] tang-bf commented on issue #11049: 想要通过SimpleApplicationEventMulticaster自定义线程池提高export 启动速度

Posted by GitBox <gi...@apache.org>.
tang-bf commented on issue #11049:
URL: https://github.com/apache/dubbo/issues/11049#issuecomment-1330320299

   如果再同时设置delay,会导致getDeployment().getRegistry() 抛出NPE。报错信息如下:
   Exception in thread "DelayExportServiceThread" java.lang.NullPointerException
           at com.alibaba.dubbo.rpc.protocol.rest.BaseRestServer.deploy(BaseRestServer.java:55)
           at com.alibaba.dubbo.rpc.protocol.rest.RestProtocol.doExport(RestProtocol.java:116)
           at com.alibaba.dubbo.rpc.protocol.AbstractProxyProtocol.export(AbstractProxyProtocol.java:69)
           at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:56)
           at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:55)
           at com.alibaba.dubbo.rpc.Protocol$Adpative.export(Protocol$Adpative.java)
           at com.alibaba.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:495)
           at com.alibaba.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:285)
           at com.alibaba.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:246)
           at com.alibaba.dubbo.config.ServiceConfig$1.run(ServiceConfig.java:138)


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] 想要通过SimpleApplicationEventMulticaster自定义线程池提高export 启动速度 [dubbo]

Posted by "wxbty (via GitHub)" <gi...@apache.org>.
wxbty closed issue #11049: 想要通过SimpleApplicationEventMulticaster自定义线程池提高export 启动速度
URL: https://github.com/apache/dubbo/issues/11049


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] 想要通过SimpleApplicationEventMulticaster自定义线程池提高export 启动速度 [dubbo]

Posted by "wxbty (via GitHub)" <gi...@apache.org>.
wxbty commented on issue #11049:
URL: https://github.com/apache/dubbo/issues/11049#issuecomment-2026747601

   @tang-bf   If you still have problems, please add samples and restart the issue at any 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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #11049: 想要通过SimpleApplicationEventMulticaster自定义线程池提高export 启动速度

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #11049:
URL: https://github.com/apache/dubbo/issues/11049#issuecomment-1330514631

   `com.alibaba.dubbo` 是 2.6.x 及以前版本的包名,请升级到最新的 3.x 版本试一下。


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org