Tsz-wo Sze created HDDS-9527:
--------------------------------

             Summary: Race condition in RocksDatabase
                 Key: HDDS-9527
                 URL: https://issues.apache.org/jira/browse/HDDS-9527
             Project: Apache Ozone
          Issue Type: Bug
          Components: db
            Reporter: Tsz-wo Sze


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.
{code}
  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();
    }
  }
{code}




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to