-
Bug
-
Resolution: Done
-
Major
-
None
-
None
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) {
}
}
}