[
https://issues.apache.org/jira/browse/HDDS-16262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated HDDS-16262:
----------------------------------
Labels: pull-request-available (was: )
> Fix thread-safety issues in AbstractCommitWatcher
> -------------------------------------------------
>
> Key: HDDS-16262
> URL: https://issues.apache.org/jira/browse/HDDS-16262
> Project: Apache Ozone
> Issue Type: Improvement
> Components: Ozone Client
> Reporter: Ren Koike
> Assignee: Ren Koike
> Priority: Major
> Labels: pull-request-available
>
> AbstractCommitWatcher is shared by both the DataStream path
> (StreamCommitWatcher) and the Ratis path (CommitWatcher). It has
> check-then-act sequences in watchOnFirstIndex() and watchOnLastIndex() that
> are not synchronized, while other mutating methods (updateCommitInfoMap,
> adjustBuffers) are synchronized. A concurrent
> drain between isEmpty() and firstKey()/lastKey() can cause
> NoSuchElementException.
> Fix: add synchronized to the watch methods to match the existing locking
> policy, and document the threading contract for releaseBuffers().
> Both the DataStream and Ratis paths benefit from this fix.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]