[ 
https://issues.apache.org/jira/browse/HDDS-13020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18136280#comment-18136280
 ] 

Sumit Agrawal commented on HDDS-13020:
--------------------------------------

Processing of queue can be slow, and if DN events keeps coming may cause queue 
to be holding huge number of events, and even may cause OOM as observed earlier.

So queue needs to be limited and may need be blocking OR reject HB from SCM to 
be send again.

> 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
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to