tobizhang opened a new issue, #13560:
URL: https://github.com/apache/dubbo/issues/13560

   
   ### Environment
   
   * Dubbo version: 3.2.10
   * Operating System version: mac
   * Java version: jdk8
   
   ### Steps to reproduce this issue
   
   1. 使用dubbo-spring-boot-starter和nacos通过springboot 
web应用拉起dubbo提供者服务时,会deadlock,日志如下:
   "main" Id=1 BLOCKED on org.apache.dubbo.config.spring.ServiceBean@4840dee0 
owned by "Dubbo-ots-service-export-thread-1" Id=300
       at org.apache.dubbo.config.ServiceConfig.register(ServiceConfig.java:353)
       -  blocked on org.apache.dubbo.config.spring.ServiceBean@4840dee0
       at 
org.apache.dubbo.config.deploy.DefaultModuleDeployer.registerServiceInternal(DefaultModuleDeployer.java:491)
       at 
org.apache.dubbo.config.deploy.DefaultModuleDeployer.registerServices(DefaultModuleDeployer.java:431)
       at 
org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:191)
       -  locked org.apache.dubbo.config.deploy.DefaultModuleDeployer@19d1ac5
       at 
org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:156)
       at 
org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:153)
       -  locked java.util.concurrent.ConcurrentHashMap@381ae39 <---- but 
blocks 6 other threads!
       at 
org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:138)
       at 
org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:47)
       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.multicastEvent(SimpleApplicationEventMulticaster.java:139)
       at 
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:398)
       at 
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:355)
       at 
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:882)
       at 
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:163)
       at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
       -  locked java.lang.Object@3775b7f2
       at 
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
       at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
       at 
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
       at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
       at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
       at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
       at com.xxx.cpods.xxx.rpc.api.RpcApplication.main(RpcApplication.java:83)
   
   
通过去除DubboDeployApplicationListener.onContextRefreshedEvent中的synchronized代码可以解决这个死锁问题。但不知是否有其他影响


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to