[ 
https://issues.apache.org/jira/browse/HDDS-9527?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tsz-wo Sze resolved HDDS-9527.
------------------------------
    Fix Version/s: 1.5.0
       Resolution: Fixed

The pull request is now merged.  Thanks, [~sumitagrawl]!

> 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
>            Assignee: Sumit Agrawal
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.5.0
>
>
> 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: issues-unsubscr...@ozone.apache.org
For additional commands, e-mail: issues-h...@ozone.apache.org

Reply via email to