You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2025/05/11 22:21:00 UTC

[jira] [Updated] (HDDS-13020) The LinkedBlockingQueue in ContainerReportQueue may cause unnecessary contentions between EventExecutors

     [ https://issues.apache.org/jira/browse/HDDS-13020?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated HDDS-13020:
----------------------------------
    Labels: pull-request-available  (was: )

> The LinkedBlockingQueue in ContainerReportQueue may cause unnecessary contentions between EventExecutors
> --------------------------------------------------------------------------------------------------------
>
>                 Key: HDDS-13020
>                 URL: https://issues.apache.org/jira/browse/HDDS-13020
>             Project: Apache Ozone
>          Issue Type: Bug
>          Components: SCM
>    Affects Versions: 1.4.0
>            Reporter: Shangshu Qian
>            Priority: Major
>              Labels: pull-request-available
>
> In the current implementation of `ContainerReportQueue`, the `orderingQueue` is initialized as a `LinkedBlockingQueue`, and the `FixedThreadPoolWithAffinityExecutor` expects a BlockingQueue interface for its internal `workQueues`.
> Using a `LinkedBlockingQueue` introduces unnecessary locking at every queue operation, and could be of low performance. We can substitute it with `ConcurrentLinkedQueue`, which has a much better performance.
> Plus, it seems that we don't really need the blocking behavior of the queue because we would check the remaining capacity even before adding value to the queue. Also, we already holds a lock for this object. There is no need for additional locking.
> {code:java}
>   @Override
>   public boolean add(@NotNull ContainerReport value) {
>     Objects.requireNonNull(value);
>     synchronized (this) {
>       if (remainingCapacity() == 0) {
>         throw new IllegalStateException("capacity not available");
>       }      return addValue(value);
>     }
>   }
> {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