Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] application shutdown report error:java.lang.IllegalStateException: Shutdown in progress #14429

Open
3 of 4 tasks
ldcsaa opened this issue Jul 13, 2024 · 3 comments
Open
3 of 4 tasks
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage

Comments

@ldcsaa
Copy link

ldcsaa commented Jul 13, 2024

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

Dubbo Java 3.2.14, JDK 17

Steps to reproduce this issue

When shutdown dubbo spring-boot application, some times report this error:

2024-07-12 01:00:39.369 WARN  [SpringApplicationShutdownHook] o.a.d.common.logger.log4j2.Log4j2Logger#warn(L:86) ->  [DUBBO] unregister shutdown hook failed: Shutdown in progress, dubbo version: 3.2.14, current host: 172.18.0.15, error code: 5-2. This may be caused by , go to https://dubbo.apache.org/faq/5/2 to find instructions. 
java.lang.IllegalStateException: Shutdown in progress
	at java.base/java.lang.ApplicationShutdownHooks.remove(Unknown Source) ~[?:?]
	at java.base/java.lang.Runtime.removeShutdownHook(Unknown Source) ~[?:?]
	at org.apache.dubbo.config.DubboShutdownHook.unregister(DubboShutdownHook.java:171) ~[dubbo-3.2.14.jar!/:3.2.14]
	at org.apache.dubbo.config.deploy.DefaultApplicationDeployer.unRegisterShutdownHook(DefaultApplicationDeployer.java:182) ~[dubbo-3.2.14.jar!/:3.2.14]
	at org.apache.dubbo.config.deploy.DefaultApplicationDeployer.preDestroy(DefaultApplicationDeployer.java:1063) ~[dubbo-3.2.14.jar!/:3.2.14]
	at org.apache.dubbo.rpc.model.ApplicationModel.onDestroy(ApplicationModel.java:155) ~[dubbo-3.2.14.jar!/:3.2.14]
	at org.apache.dubbo.rpc.model.ScopeModel.destroy(ScopeModel.java:122) ~[dubbo-3.2.14.jar!/:3.2.14]
	at org.apache.dubbo.rpc.model.ApplicationModel.tryDestroy(ApplicationModel.java:276) ~[dubbo-3.2.14.jar!/:3.2.14]
	at org.apache.dubbo.rpc.model.ModuleModel.onDestroy(ModuleModel.java:133) ~[dubbo-3.2.14.jar!/:3.2.14]
	at org.apache.dubbo.rpc.model.ScopeModel.destroy(ScopeModel.java:122) ~[dubbo-3.2.14.jar!/:3.2.14]
	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextClosedEvent(DubboDeployApplicationListener.java:189) ~[dubbo-3.2.14.jar!/:3.2.14]
	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:145) ~[dubbo-3.2.14.jar!/:3.2.14]
	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:52) ~[dubbo-3.2.14.jar!/:3.2.14]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185) ~[spring-context-6.1.10.jar!/:6.1.10]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178) ~[spring-context-6.1.10.jar!/:6.1.10]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:156) ~[spring-context-6.1.10.jar!/:6.1.10]
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:451) ~[spring-context-6.1.10.jar!/:6.1.10]
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:384) ~[spring-context-6.1.10.jar!/:6.1.10]
	at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1130) ~[spring-context-6.1.10.jar!/:6.1.10]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.doClose(ServletWebServerApplicationContext.java:174) ~[spring-boot-3.2.7.jar!/:3.2.7]
	at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1093) ~[spring-context-6.1.10.jar!/:6.1.10]
	at org.springframework.boot.SpringApplicationShutdownHook.closeAndWait(SpringApplicationShutdownHook.java:145) ~[spring-boot-3.2.7.jar!/:3.2.7]
	at java.base/java.lang.Iterable.forEach(Unknown Source) ~[?:?]
	at org.springframework.boot.SpringApplicationShutdownHook.run(SpringApplicationShutdownHook.java:114) ~[spring-boot-3.2.7.jar!/:3.2.7]
	at java.base/java.lang.Thread.run(Unknown Source) [?:?]

What you expected to happen

don't report error

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

@ldcsaa ldcsaa added component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage labels Jul 13, 2024
Chenjp added a commit to Chenjp/dubbo that referenced this issue Jul 15, 2024
When we register DubboShutdownHook, actions-on-exit are expected. So we should not disable the Hook.
@AlbumenJ AlbumenJ changed the title [Bug] (Dubbo 3.2.14)application shutdown report error:java.lang.IllegalStateException: Shutdown in progress [Bug] application shutdown report error:java.lang.IllegalStateException: Shutdown in progress Jul 16, 2024
@AlbumenJ
Copy link
Member

Will be fixed in #14432

@Chenjp
Copy link
Contributor

Chenjp commented Jul 19, 2024

Will be fixed in #14432

@AlbumenJ PTAL #14432

@Chenjp
Copy link
Contributor

Chenjp commented Sep 25, 2024

@AlbumenJ If PR #14432 is not ready to merge, will close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

3 participants