You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/06/13 13:01:46 UTC

[GitHub] [dubbo] xiaohei88 opened a new issue, #10150: shutdown后报错:Expected state [STARTED] was [STOPPED]

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

   <!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
   
   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: 2.7.15
   * Operating System version: mac
   * Java version: 8
   
   ### Steps to reproduce this issue
   环境:zk:3.6.0以上,curator:5.1.0以上
   
   shutdown后,会报错:
   ```java
   20:57:49.731 [main-EventThread] ERROR o.a.c.f.recipes.cache.NodeCache - 
   java.lang.IllegalStateException: Expected state [STARTED] was [STOPPED]
   	at org.apache.curator.shaded.com.google.common.base.Preconditions.checkState(Preconditions.java:823)
   	at org.apache.curator.framework.imps.CuratorFrameworkImpl.checkState(CuratorFrameworkImpl.java:457)
   	at org.apache.curator.framework.imps.CuratorFrameworkImpl.checkExists(CuratorFrameworkImpl.java:484)
   	at org.apache.curator.framework.recipes.cache.NodeCache.reset(NodeCache.java:261)
   	at org.apache.curator.framework.recipes.cache.NodeCache.access$100(NodeCache.java:60)
   	at org.apache.curator.framework.recipes.cache.NodeCache$2.process(NodeCache.java:104)
   	at org.apache.curator.framework.imps.NamespaceWatcher.process(NamespaceWatcher.java:77)
   	at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:588)
   	at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:563)
   ```
   <img width="1212" alt="image" src="https://user-images.githubusercontent.com/2033687/173359443-5ac91e24-3ea9-4d7f-bdb1-f2ec48368c42.png">
   
   将zk降级到3.6.0以下就不会有这个问题,因为没框框里面这个事件。


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

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


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


[GitHub] [dubbo] DemoCap commented on issue #10150: shutdown后报错:Expected state [STARTED] was [STOPPED]

Posted by GitBox <gi...@apache.org>.
DemoCap commented on issue #10150:
URL: https://github.com/apache/dubbo/issues/10150#issuecomment-1177342309

   > 这里的问题和 Dubbo 关联点是什么,有什么修改建议么?
   
   Environment
   Dubbo version: 2.7.16
   Operating System version: window 11
   Java version: 8
   Steps to reproduce this issue
   环境:zk:3.7.1,curator:5.2.1。
   
   ![image](https://user-images.githubusercontent.com/2033687/173359443-5ac91e24-3ea9-4d7f-bdb1-f2ec48368c42.png)
   ![image](https://user-images.githubusercontent.com/18241019/177744606-0a1692d0-765a-4e37-817b-ac603ce609fe.png)
   
   错误发生时的调用堆栈如下:
   ```java
       org.apache.curator.framework.recipes.cache.NodeCache$2#process(104)
       org.apache.curator.framework.imps.NamespaceWatcher#process(77)
       org.apache.zookeeper.ClientCnxn$EventThread#processEvent(578)
       org.apache.zookeeper.ClientCnxn$EventThread#run(553)
   ```
   
   我暂时通过覆盖org.apache.curator.framework.recipes.cache.NodeCache#watcher#process(WatchedEvent event)方法抑制了错误
   ```java
   private Watcher watcher = new Watcher()
       {
           @Override
           public void process(WatchedEvent event)
           {
               try
               {
                  //change start
                   if(event.getState().equals(Event.KeeperState.Closed) && null == event.getPath() && Event.EventType.None.equals(event.getType())){
                       return;
                   }
                     //change end
                   reset();
               }
               catch(Exception e)
               {
                   ThreadUtils.checkInterrupted(e);
                   handleException(e);
               }
           }
       };
   ```
   我想Curator5ZookeeperClient使用了被标记为Deprecated的org.apache.curator.framework.recipes.cache.NodeCache,如果更换为org.apache.curator.framework.recipes.cache.CuratorCache是否为更好,由于未能读懂源码,我没能替换成功。


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

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


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


[GitHub] [dubbo] wow981 commented on issue #10150: shutdown后报错:Expected state [STARTED] was [STOPPED]

Posted by "wow981 (via GitHub)" <gi...@apache.org>.
wow981 commented on issue #10150:
URL: https://github.com/apache/dubbo/issues/10150#issuecomment-1594206775

   springboot 使用3.2.2版本 优雅停机也会有这个异常。
   dubbo-dependencies-zookeeper:3.2.2
   org.apache.dubbo:dubbo-spring-boot-starter:3.2.2
   
   2023-06-16 14:54:06.738 [ERROR]-[main-EventThread] [] org.apache.curator.framework.recipes.cache.NodeCache - 
   java.lang.IllegalStateException: Expected state [STARTED] was [STOPPED]
   	at org.apache.curator.shaded.com.google.common.base.Preconditions.checkState(Preconditions.java:823) ~[curator-client-4.3.0.jar:?]
   	at org.apache.curator.framework.imps.CuratorFrameworkImpl.checkState(CuratorFrameworkImpl.java:432) ~[curator-framework-4.3.0.jar:4.3.0]
   	at org.apache.curator.framework.imps.CuratorFrameworkImpl.checkExists(CuratorFrameworkImpl.java:459) ~[curator-framework-4.3.0.jar:4.3.0]
   	at org.apache.curator.framework.recipes.cache.NodeCache.reset(NodeCache.java:258) ~[curator-recipes-4.3.0.jar:4.3.0]
   	at org.apache.curator.framework.recipes.cache.NodeCache.access$100(NodeCache.java:57) ~[curator-recipes-4.3.0.jar:4.3.0]
   	at org.apache.curator.framework.recipes.cache.NodeCache$2.process(NodeCache.java:101) ~[curator-recipes-4.3.0.jar:4.3.0]
   	at org.apache.curator.framework.imps.NamespaceWatcher.process(NamespaceWatcher.java:77) ~[curator-framework-4.3.0.jar:4.3.0]
   	at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:578) ~[zookeeper-3.8.1.jar:3.8.1]
   	at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:553) ~[zookeeper-3.8.1.jar:3.8.1]
   
   
   


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

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


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


Re: [I] shutdown后报错:Expected state [STARTED] was [STOPPED] [dubbo]

Posted by "aimilin6688 (via GitHub)" <gi...@apache.org>.
aimilin6688 commented on issue #10150:
URL: https://github.com/apache/dubbo/issues/10150#issuecomment-2053523723

   我的 v3.2.11  存在同样的问题


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

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


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


[GitHub] [dubbo] JavaHello commented on issue #10150: shutdown后报错:Expected state [STARTED] was [STOPPED]

Posted by "JavaHello (via GitHub)" <gi...@apache.org>.
JavaHello commented on issue #10150:
URL: https://github.com/apache/dubbo/issues/10150#issuecomment-1543186336

   3.1.7 有同样的问题


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

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


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


Re: [I] shutdown后报错:Expected state [STARTED] was [STOPPED] [dubbo]

Posted by "kuman62 (via GitHub)" <gi...@apache.org>.
kuman62 commented on issue #10150:
URL: https://github.com/apache/dubbo/issues/10150#issuecomment-1788613963

   dubbo 2.7.23 curator 4.3.0 zookeeper 3.5.7 存在同样的问题。升级curator至5.x不能解决问题。只有当将dubbo降级到2.7.8没问题。


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

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


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


[GitHub] [dubbo] JavaHello commented on issue #10150: shutdown后报错:Expected state [STARTED] was [STOPPED]

Posted by "JavaHello (via GitHub)" <gi...@apache.org>.
JavaHello commented on issue #10150:
URL: https://github.com/apache/dubbo/issues/10150#issuecomment-1674860153

   > 如果不使用ZK作为配置中心或不使用配置中心,可以通过设置dubbo.registry.useAsConfigCenter=false回避这个错误。通过断点发现使用该功能会多增加几个以.configurator为后缀的watcher。虽然root cause仍未找到但没有发现这样修改对基础功能有其他影响,包括优雅停机。 PS:ZK的降级目前测试不能解决该问题 测试环境:dubbo 2.7.23(2.7.8没有该问题),curator 5.1.0 zookeeper 3.6.1
   
   - `dubbo 3.1.7` `curator 5.4.0` `zookeeper 3.7.1` 配置后没有出现报错了
   - 如果使用 spring 的优雅停机(https://github.com/apache/dubbo/issues/12210), 需要添加 `-Ddubbo.shutdownHook.listenIgnore=true`


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

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


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


[GitHub] [dubbo] AlbumenJ commented on issue #10150: shutdown后报错:Expected state [STARTED] was [STOPPED]

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #10150:
URL: https://github.com/apache/dubbo/issues/10150#issuecomment-1676820277

   > * 如果使用 spring 的优雅停机([Dubbo3优雅上下线问题 #12210](https://github.com/apache/dubbo/issues/12210)), 需要添加 `-Ddubbo.shutdownHook.listenIgnore=true`
   
   3.2.x 以后可以不需要配置 Shutdown Hook 的忽略了,会自动等待 Spring 完成的


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

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


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


[GitHub] [dubbo] chickenlj commented on issue #10150: shutdown后报错:Expected state [STARTED] was [STOPPED]

Posted by GitBox <gi...@apache.org>.
chickenlj commented on issue #10150:
URL: https://github.com/apache/dubbo/issues/10150#issuecomment-1154768474

   这里的问题和 Dubbo 关联点是什么,有什么修改建议么?


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

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


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


[GitHub] [dubbo] liaozan commented on issue #10150: shutdown后报错:Expected state [STARTED] was [STOPPED]

Posted by "liaozan (via GitHub)" <gi...@apache.org>.
liaozan commented on issue #10150:
URL: https://github.com/apache/dubbo/issues/10150#issuecomment-1644308951

   请问这个 fix 什么时候合并?


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

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


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


[GitHub] [dubbo] wow981 commented on issue #10150: shutdown后报错:Expected state [STARTED] was [STOPPED]

Posted by "wow981 (via GitHub)" <gi...@apache.org>.
wow981 commented on issue #10150:
URL: https://github.com/apache/dubbo/issues/10150#issuecomment-1594204829

   org.apache.dubbo:dubbo-spring-boot-starter:3.2.2


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

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


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


[GitHub] [dubbo] H-Bob commented on issue #10150: shutdown后报错:Expected state [STARTED] was [STOPPED]

Posted by GitBox <gi...@apache.org>.
H-Bob commented on issue #10150:
URL: https://github.com/apache/dubbo/issues/10150#issuecomment-1231085783

   I have the same problem and I've tried in some ways, like changing zk version or monitoring my thread model. However, it has not be solved.
   
   Environment
   
   Dubbo version: 3.0.8
   Operating System version: mac and windows 10
   Java version: 17
   zk: 3.7.1
   curator: 5.2.1


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

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


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


[GitHub] [dubbo] xiaohei88 commented on issue #10150: shutdown后报错:Expected state [STARTED] was [STOPPED]

Posted by GitBox <gi...@apache.org>.
xiaohei88 commented on issue #10150:
URL: https://github.com/apache/dubbo/issues/10150#issuecomment-1153891645

   https://github.com/apache/zookeeper/pull/1874/files/4ecb98285a95d3e608c258fbdbd966b5b98372b1#diff-9657d4a14708c9ec1df56fd01581a442e10ef70cae39c7223d4f979b0ae54263


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

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


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


[GitHub] [dubbo] danielludan commented on issue #10150: shutdown后报错:Expected state [STARTED] was [STOPPED]

Posted by "danielludan (via GitHub)" <gi...@apache.org>.
danielludan commented on issue #10150:
URL: https://github.com/apache/dubbo/issues/10150#issuecomment-1672926493

   如果不使用配置中心功能,可以通过设置dubbo.registry.useAsConfigCenter=false回避这个错误。通过断点发现使用该功能会多增加几个以.configurator为后缀的watcher。虽然root cause仍未找到但没有发现这样修改对基础功能有其他影响,包括优雅停机。
   PS:ZK的降级目前测试不能解决该问题
   测试环境:dubbo 2.7.23(2.7.8没有该问题),curator 5.1.0  zookeeper 3.6.1


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

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


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


Re: [I] shutdown后报错:Expected state [STARTED] was [STOPPED] [dubbo]

Posted by "kuman62 (via GitHub)" <gi...@apache.org>.
kuman62 commented on issue #10150:
URL: https://github.com/apache/dubbo/issues/10150#issuecomment-2053651986

   dependencies {
       implementation 'org.apache.dubbo:dubbo:2.7.23'
       implementation 'org.apache.dubbo:dubbo-dependencies-zookeeper:2.7.23'
       implementation 'org.apache.curator:curator-framework:4.2.0'
       implementation 'org.apache.zookeeper:zookeeper:3.5.7' {
           exclude group: 'org.slf4j', module: 'lf4j-log4j12'
       }
   }
   
   依赖包不同版本存在冲突,按照上面的依赖包版本可正常


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

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


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