len548 opened a new pull request, #11512: URL: https://github.com/apache/ozone/pull/11512
## What changes were proposed in this pull request? `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. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-16262 ## How was this patch tested? CI pass: https://github.com/len548/ozone/actions/runs/38248785940 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
