代码的逻辑的入口,参考:org.apache.dubbo.config.DubboShutdownHook#doDestroy。

```java.lang.IllegalStateException: Failed to unregister 
dubbo://192.168.199.229:20880/org.apache.dubbo.samples.generic.api.IUserService?anyhost=true&application=generic-generic&default.timeout=5000&dubbo=2.0.2&generic=false&interface=org.apache.dubbo.samples.generic.api.IUserService&methods=get&pid=2705&side=provider&specVersion=2.7.0-SNAPSHOT&timestamp=1547389521528
 to registry 127.0.0.1:2181, cause: Failed to unregister 
dubbo://192.168.199.229:20880/org.apache.dubbo.samples.generic.api.IUserService?anyhost=true&application=generic-generic&default.timeout=5000&dubbo=2.0.2&generic=false&interface=org.apache.dubbo.samples.generic.api.IUserService&methods=get&pid=2705&side=provider&specVersion=2.7.0-SNAPSHOT&timestamp=1547389521528
 to zookeeper 
zookeeper://127.0.0.1:2181/org.apache.dubbo.registry.RegistryService?application=generic-generic&dubbo=2.0.2&interface=org.apache.dubbo.registry.RegistryService&pid=2705&specVersion=2.7.0-SNAPSHOT&timestamp=1547389521520,
 cause: instance must be started before calling this method
        at 
org.apache.dubbo.registry.support.FailbackRegistry.unregister(FailbackRegistry.java:273)
        at 
org.apache.dubbo.registry.integration.RegistryProtocol$ExporterChangeableWrapper.unexport(RegistryProtocol.java:637)
        at 
org.apache.dubbo.registry.integration.RegistryProtocol.destroy(RegistryProtocol.java:408)
        at 
org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.destroy(ProtocolFilterWrapper.java:121)
        at 
org.apache.dubbo.qos.protocol.QosProtocolWrapper.destroy(QosProtocolWrapper.java:77)
        at 
org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.destroy(ProtocolListenerWrapper.java:75)
        at 
org.apache.dubbo.config.DubboShutdownHook.destroyProtocols(DubboShutdownHook.java:103)
        at 
org.apache.dubbo.config.DubboShutdownHook.doDestroy(DubboShutdownHook.java:91)
```
执行org.apache.dubbo.config.DubboShutdownHook.destroyProtocols之前,已经执行了AbstractRegistryFactory.destroyAll(),
 
这个方法里已经去执行了zookeeperClient的close方法。参考:org.apache.dubbo.registry.zookeeper.ZookeeperRegistry#destroy
```
    @Override
    public void destroy() {
        super.destroy();
        try {
            zkClient.close();
        } catch (Exception e) {
            logger.warn("Failed to close zookeeper client " + getUrl() + ", 
cause: " + e.getMessage(), e);
        }
    }
```

[ Full content available at: 
https://github.com/apache/incubator-dubbo/issues/3218 ]
This message was relayed via gitbox.apache.org for 
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to