[jboss-jira] [JBoss JIRA] (JGRP-1986) TransferQueueBundler: sending messages one-by-one when threshold has been exceeded

Bela Ban (JIRA) issues at jboss.org
Tue Nov 24 08:30:00 EST 2015


Bela Ban created JGRP-1986:
------------------------------

             Summary: TransferQueueBundler: sending messages one-by-one when threshold has been exceeded
                 Key: JGRP-1986
                 URL: https://issues.jboss.org/browse/JGRP-1986
             Project: JGroups
          Issue Type: Bug
            Reporter: Bela Ban
            Assignee: Bela Ban


In {{TP.TransferQueueBundler}}, when the queue's threshold (90% of the queue's capacity) is exceeded, messages are dequeued and sent one-by-one. See {{queue.take()}} and {{queue.poll()}} below.
This is inefficient and slows down sending of messages until the queue size falls below the threshold again.
Solution: remove {{threshold}} and the associated checks.

{noformat}
 public void run() {
            while(Thread.currentThread() == bundler_thread) {
                Message msg=null;
                try {
                    if(count == 0) {
                        msg=queue.take();
                        if(msg == null)
                            continue;
                        long size=msg.size();
                        if(count + size >= max_bundle_size || queue.size() >= threshold)
                            sendBundledMessages();
                        addMessage(msg, size);
                    }
                    while(null != (msg=queue.poll())) {
                        long size=msg.size();
                        if(count + size >= max_bundle_size || queue.size() >= threshold)
                            sendBundledMessages();
                        addMessage(msg, size);
                    }
                    if(count > 0)
                        sendBundledMessages();
                }
                catch(Throwable t) {
                }
            }
        }
{noformat}



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list