Skip to content

dubbo 停应用时DubboShutdownHook 报java.lang.RuntimeException: java.util.ConcurrentModificationException错误 #6027

@bxvs888

Description

@bxvs888
  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version:2.7.6
  • Operating System version: Mac 10.15
  • Java version: 11
    registry:nacos 1.2.0

Steps to reproduce this issue

  1. 在停应用时,出现以下错误

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

What do you expected from the above steps?

Actual Result

What actually happens?

If there is an exception, please attach the exception trace:

2020-04-17 17:53:01.735  INFO 41463  DubboShutdownHook o.a.d.r.n.NacosRegistry :  [DUBBO] Destroy unsubscribe url consumer://169.254.202.113/org.apache.dubbo.rpc.service.GenericService?application=dubbo-admin-gateway&category=providers,configurators,routers&check=false&connections=0&dubbo=2.0.2&generic=true&interface=com.bw.api.UiPageTableService&pid=41463&qos.enable=false&qos.port=22222&release=2.7.6&retries=0&side=consumer&sticky=false&timeout=32000&timestamp=1587116295070&version=1.0.0, dubbo version: 2.7.6, current host: 169.254.202.113
Exception in thread "DubboShutdownHook" java.lang.RuntimeException: java.util.ConcurrentModificationException
	at org.apache.dubbo.common.function.ThrowableAction.execute(ThrowableAction.java:48)
	at org.apache.dubbo.common.lang.ShutdownHookCallbacks.lambda$callback$0(ShutdownHookCallbacks.java:70)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at org.apache.dubbo.common.lang.ShutdownHookCallbacks.callback(ShutdownHookCallbacks.java:70)
	at org.apache.dubbo.config.DubboShutdownHook.callback(DubboShutdownHook.java:85)
	at org.apache.dubbo.config.DubboShutdownHook.run(DubboShutdownHook.java:73)
Caused by: java.util.ConcurrentModificationException
	at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1493)
	at java.base/java.util.HashMap$ValueIterator.next(HashMap.java:1521)
	at java.base/java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1047)
	at org.apache.dubbo.registry.support.AbstractRegistryFactory.destroyAll(AbstractRegistryFactory.java:85)
	at org.apache.dubbo.config.DubboShutdownHook.destroyAll(DubboShutdownHook.java:128)
	at org.apache.dubbo.config.bootstrap.DubboBootstrap.destroy(DubboBootstrap.java:1039)
	at org.apache.dubbo.config.bootstrap.DubboBootstrap$1.callback(DubboBootstrap.java:191)
	at org.apache.dubbo.common.function.ThrowableAction.execute(ThrowableAction.java:46)
	... 5 more
^C2020-04-17 17:53:02.036  INFO 41463  SpringContextShutdownHook c.a.c.n.r.NacosServiceRegistry : De-registering from Nacos Server now...
2020-04-17 17:53:02.041  INFO 41463  SpringContextShutdownHook c.a.c.n.r.NacosServiceRegistry : De-registration finished.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions