You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@zookeeper.apache.org by "nagi kami (Jira)" <ji...@apache.org> on 2022/08/03 06:04:00 UTC

[jira] [Resolved] (ZOOKEEPER-4605) When deciding whether to send more notifications, no check is made that all queues are empty

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

nagi kami resolved ZOOKEEPER-4605.
----------------------------------
    Resolution: Not A Bug

> When deciding whether to send more notifications, no check is made that all queues are empty
> --------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-4605
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4605
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>            Reporter: nagi kami
>            Priority: Trivial
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> The current implementation only checks that one queue is empty and not all queues are empty.
> {code:java}
> boolean haveDelivered() {
>     for (BlockingQueue<ByteBuffer> queue : queueSendMap.values()) {
>         final int queueSize = queue.size();
>         LOG.debug("Queue size: {}", queueSize);
>         if (queueSize == 0) {
>             return true;
>         }
>     }
>     return false;
> } {code}
> Perhaps it could be:
> {code:java}
> boolean haveDelivered() {
>     for (BlockingQueue<ByteBuffer> queue : queueSendMap.values()) {
>         final int queueSize = queue.size();
>         LOG.debug("Queue size: {}", queueSize);
>         if (queueSize != 0) {
>             return false;
>         }
>     }
>     return true;
> } {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)