You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Gargi-jais11 (via GitHub)" <gi...@apache.org> on 2026/03/19 05:52:38 UTC
Re: [PR] HDDS-14855. Add synchronization in ThrottledAsyncChecker#schedule [ozone]
Gargi-jais11 commented on code in PR #9942:
URL: https://github.com/apache/ozone/pull/9942#discussion_r2958021034
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/ThrottledAsyncChecker.java:
##########
@@ -117,39 +117,41 @@ public ThrottledAsyncChecker(final Timer timer,
@Override
public Optional<ListenableFuture<V>> schedule(
Checkable<K, V> target, K context) {
- if (checksInProgress.containsKey(target)) {
- return Optional.empty();
- }
+ synchronized (ThrottledAsyncChecker.this) {
+ if (checksInProgress.containsKey(target)) {
Review Comment:
Why not simply make the method itself `synchronized` instead of using a block? This has the same effecct and simple to read.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org