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

   ### Pre-check
   
   - [X] I am sure that all the content I provide is in English.
   
   
   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Apache Dubbo Component
   
   Java SDK (apache/dubbo)
   
   ### Dubbo Version
   
   2.7.22
   
   ### Steps to reproduce this issue
   
   springboot项目集成dubbo 2.7.22, dubbo.xml有dubbo:reference引用,类似于  
<dubbo:reference interface="com.xdd.test.demo44.remote.IUserServiceRemote" 
id="userServiceRemote"/>
   
启动springboot后,然后观查java.lang.ApplicationShutdownHooks.hooks变量,会多出一个DubboShutdownHook对象
   
   ### What you expected to happen
   
   
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean先执行了DubboShutdownHook.getDubboShutdownHook().unregister()
   
    
给bean的属性赋值时org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean
 再执行DubboShutdownHook.getDubboShutdownHook().register()
   
   
顺序搞反了,导致consumer启动后一直会有DubboShutdownHook这个勾子,在consumer停止的时候,DubboShutdownHook可能会优先于SpringApplicationShutdownHook执行,把没有执行完的任务直接关闭,出现Interrupted
 unexpectedly while waiting for异常
   
![image](https://github.com/user-attachments/assets/fa3a9c24-5f97-40c4-9da1-915c5744bc7c)。
   
   ### Anything else
   
   好像也看到类似的问题,不过不是这个版本https://github.com/apache/dubbo/issues/7093。
   
   dubbo2.7.3是没有这个bug的。
   
   
我现在的解决方法是在springboot启动后,直接调用DubboShutdownHook.getDubboShutdownHook().unregister();
   
   ### Are you willing to submit a pull request to fix on your own?
   
   - [X] Yes I am willing to submit a pull request on my own!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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-unsubscr...@dubbo.apache.org.apache.org

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


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

Reply via email to