Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-1889

ZooKeeperInstance close method should mark instance closed.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.5, 1.5.1
    • 1.4.5, 1.5.1, 1.6.0
    • None
    • None

    Description

      (1.4.5 and 1.5.1 impact presumes ACCUMULO-1858 gets applied)

      The current close() implementation on ZooKeeperInstance only marks a given instance as closed if the outstanding client count is 0.

        public synchronized void close() throws AccumuloException {
          if (!closed && clientInstances.decrementAndGet() == 0) {
            try {
              zooCache.close();
              ThriftUtil.close();
            } catch (InterruptedException e) {
              clientInstances.incrementAndGet();
              throw new AccumuloException("Issues closing ZooKeeper.");
            }
            closed = true;
          }
        }
      

      This is incorrect for two reason:

      1) It allows continued operations on a given ZKI after it has had close() called on it

      2) It allows a given ZKI to decrement the number of open clients more than once

      Attachments

        1. ACCUMULO-1889.1.patch.txt
          1 kB
          Sean Busbey

        Issue Links

          Activity

            People

              busbey Sean Busbey
              busbey Sean Busbey
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: