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

Startup race in ZooKeeperServer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 3.4.8
    • 3.4.10, 3.5.3, 3.6.0
    • jmx, server
    • None

    Description

      In attempting to upgrade Solr's ZooKeeper dependency from 3.4.6 to 3.4.8 (SOLR-8724) I ran into test failures where attempts to create a node in a newly started standalone ZooKeeperServer were failing because of an assertion in MBeanRegistry.

      ZooKeeperServer.startup() first sets up its request processor chain then registers itself in JMX, but if a connection comes in before the server's JMX registration happens, registration of the connection will fail because it trips the assertion that (effectively) its parent (the server) has already registered itself.

      ZooKeeperServer.java
          public synchronized void startup() {
              if (sessionTracker == null) {
                  createSessionTracker();
              }
              startSessionTracker();
              setupRequestProcessors();
      
              registerJMX();
      
              state = State.RUNNING;
              notifyAll();
          }
      
      MBeanRegistry.java
          public void register(ZKMBeanInfo bean, ZKMBeanInfo parent)
              throws JMException
          {
              assert bean != null;
              String path = null;
              if (parent != null) {
                  path = mapBean2Path.get(parent);
                  assert path != null;
              }
      

      This problem appears to be new with ZK 3.4.8 - AFAIK Solr never had this issue with ZK 3.4.6.

      Attachments

        1. ZOOKEEPER-2383.patch
          22 kB
          Rakesh Radhakrishnan
        2. ZOOKEEPER-2383.patch
          15 kB
          Rakesh Radhakrishnan
        3. ZOOKEEPER-2383.patch
          14 kB
          Rakesh Radhakrishnan
        4. ZOOKEEPER-2383-br-3-4.patch
          14 kB
          Rakesh Radhakrishnan
        5. ZOOKEEPER-2383.patch
          14 kB
          Rakesh Radhakrishnan
        6. zk-3.4.8-NPE.log
          12 kB
          Steven Rowe
        7. release-3.4.8-extra-logging.patch
          3 kB
          Steven Rowe
        8. zk-3.4.8-MBeanRegistry.log
          10 kB
          Steven Rowe
        9. TestZkStandaloneJMXRegistrationRaceConcurrent.java
          2 kB
          Steven Rowe

        Issue Links

          Activity

            People

              rakeshr Rakesh Radhakrishnan
              sarowe Steven Rowe
              Votes:
              2 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: