Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-1816

ClientCnxn.close() should block until threads have died

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Minor
    • Resolution: Unresolved
    • 3.3.6, 3.4.5, 3.4.11
    • None
    • java client
    • None

    Description

      In the testing of ACCUMULO-1379 and ACCUMULO-1858 it was seen that the non-blocking behavior of ClientCnxn.close(), and therefore ZooKeeper.close(), can cause a race condition when undeploying an application running in a Java container such as JBoss or Tomcat. As the close() method returns without joining on the sendThread and eventThread, those threads continue to execute/cleanup while the container is cleaning up the application's resources. If the container has unloaded classes by the time this code runs

      ZooTrace.logTraceMessage(LOG, ZooTrace.getTextTraceLevel(), "SendThread exitedloop.");
      

      A "java.lang.NoClassDefFoundError: org/apache/zookeeper/server/ZooTrace" can be seen.

      Attachments

        1. ZOOKEEPER-1816.patch
          2 kB
          wu wen

        Issue Links

          Activity

            People

              wuwen wu wen
              jaredwinick Jared Winick
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: