You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Tsz-wo Sze (Jira)" <ji...@apache.org> on 2024/01/10 16:57:00 UTC
[jira] [Resolved] (HDDS-9527) Race condition inĀ RocksDatabase
[ 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-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org