Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-1986

TransferQueueBundler: sending messages one-by-one when threshold has been exceeded

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 3.6.7
    • None
    • None

    Description

      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.

       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) {
                      }
                  }
              }
      

      Attachments

        Activity

          People

            rhn-engineering-bban Bela Ban
            rhn-engineering-bban Bela Ban
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: