Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-9527

Race condition inĀ RocksDatabase

    XMLWordPrintableJSON

Details

    Description

      Suppose thread 1 just has passed assertClose() as shown below. Since isClosed is false and counter is 0, thread 2 can call close() successfully. Then, the JVM will crash as described in HDDS-7284.

        public void put(ColumnFamily family, byte[] key, byte[] value)
            throws IOException {
          assertClose();
      //                                     <-----------  thread 1, isClosed is false, counter is 0
          try {
            counter.incrementAndGet();
            db.get().put(family.getHandle(), writeOptions, key, value);
          } catch (RocksDBException e) {
            closeOnError(e, true);
            throw toIOException(this, "put " + bytes2String(key), e);
          } finally {
            counter.decrementAndGet();
          }
        }
      

      Attachments

        Issue Links

          Activity

            People

              sumitagrawl Sumit Agrawal
              szetszwo Tsz-wo Sze
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: