[
https://issues.apache.org/jira/browse/HDDS-9527?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Attila Doroszlai updated HDDS-9527:
-----------------------------------
Target Version/s: 1.4.1
> 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: [email protected]
For additional commands, e-mail: [email protected]