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

Prevent multiple initialization of login object in each ZooKeeperSaslClient instance

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 3.4.6, 3.4.8, 3.5.0, 3.5.1
    • 3.4.9, 3.5.2, 3.6.0
    • java client
    • None

    Description

      If there are exist many ZooKeeperSaslClient instance in one process,each ZooKeeperSaslClient instance will be call synchronize method( createSaslClient),But each ZooKeeperSaslClient instance will be lock the current object(that is say ,the synchronize only for lock it's own object) ,but many instances can access the static variable login,the synchronize can't prevent other threads access the static login object,it will be cause more than one ZooKeeperSaslClient instances use the same login object,and login.startThreadIfNeeded() will be called more than one times for same login object。
      it wll cause problem:
      ERROR | [Executor task launch worker-1-SendThread(fi1:24002)] | Exception while trying to create SASL client: java.lang.IllegalThreadStateException | org.apache.zookeeper.client.ZooKeeperSaslClient.createSaslClient(ZooKeeperSaslClient.java:305)

      Attachments

        1. ZOOKEEPER-2375.patch
          2 kB
          yuemeng
        2. ZOOKEEPER-2375_01.patch
          2 kB
          yuemeng
        3. ZOOKEEPER-2375_02.patch
          2 kB
          yuemeng

        Issue Links

          Activity

            People

              yuemeng yuemeng
              yuemeng yuemeng
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: