Uploaded image for project: 'Apache Curator'
  1. Apache Curator
  2. CURATOR-554

restart zk , task in thread "Curator-ConnectionStateManager-0" stop ,leaderLatch failed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 4.0.1, 4.2.0
    • None
    • Framework
    • None

    Description

      stop zk ,after two minutes restart it.

      the thread in ConnectionStateManager named "Curator-ConnectionStateManager-0" break out the dead Loop.

      code : org.apache.curator.framework.state.ConnectionStateManager#start

      the task stopped and would not restasrt ,so that when a new connectionState (such as reconnect) coming , there would no any response.

      it will lead to leaderLatch failed.

       

      ————————————————————————————————————————

       

      Hi,all

         I have already resolved this problem , it caused by version compatibility .I uesd zookeeper-client- 3.5.1.jar  and  curaot-framwork-4.1.0.jar .

         while the JVM initializing static block in class org.apache.curator.utils.Compatibility  ,it throw a error,but not Exception!

       

      -----------------------------------------------------------

        2020-01-10T04:33:27,568|ERROR|Curator-ConnectionStateManager-0|org.apache.curator.framework.state.ConnectionStateManager|Could not inject session expiration
      java.lang.ExceptionInInitializerError: null
      at org.apache.curator.utils.Compatibility.injectSessionExpiration(Compatibility.java:66) ~[curator-client-4.1.0.jar:?]
      at org.apache.curator.framework.state.ConnectionStateManager.checkSessionExpiration(ConnectionStateManager.java:315) [curator-framework-4.1.0.jar:4.1.0]
      at org.apache.curator.framework.state.ConnectionStateManager.processEvents(ConnectionStateManager.java:287) [curator-framework-4.1.0.jar:4.1.0]
      at org.apache.curator.framework.state.ConnectionStateManager.access$000(ConnectionStateManager.java:45) [curator-framework-4.1.0.jar:4.1.0]
      at org.apache.curator.framework.state.ConnectionStateManager$1.call(ConnectionStateManager.java:121) [curator-framework-4.1.0.jar:4.1.0]
      at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_201]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201]
      at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
      Caused by: java.lang.RuntimeException: Could not access internal ZooKeeper fields
      at org.apache.curator.utils.InjectSessionExpiration.<clinit>(InjectSessionExpiration.java:75) ~[curator-client-4.1.0.jar:?]
      ... 9 more
      Caused by: java.lang.NoSuchMethodException: org.apache.zookeeper.ClientCnxnSocket.wakeupCnxn()
      at java.lang.Class.getDeclaredMethod(Class.java:2130) ~[?:1.8.0_201]
      at org.apache.curator.utils.InjectSessionExpiration.<clinit>(InjectSessionExpiration.java:70) ~[curator-client-4.1.0.jar:?]
      ... 9 more

      ------------------------------------------------------------------------------

       

      I change the code “catch Exception ”  to "catch throwable",and the error finnaly appeared .

       

      the error made my Curator-ConnectionStateManager-0 down , so that my appliacation can not known th reconnect of zk!

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            568793005@qq.com Husky Zeng
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: