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

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

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.6.7
    • Labels:
      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) {
                      }
                  }
              }
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                belaban Bela Ban
                Reporter:
                belaban Bela Ban
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: