You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2024/05/01 17:53:35 UTC

(activemq-artemis) branch main updated: ARTEMIS-4750 AMQP Large Message flow control to use runAfter

This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/main by this push:
     new 14e83faa1b ARTEMIS-4750 AMQP Large Message flow control to use runAfter
14e83faa1b is described below

commit 14e83faa1bf5523d63755ec54f42cbc1d21affc6
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Thu Apr 25 11:25:37 2024 -0400

    ARTEMIS-4750 AMQP Large Message flow control to use runAfter
    
    The resume delivery on AMQP Large Message Writer is using runNow.
    When a flow control is paused and then resumed, the runNow will make the first read to happen inline to the thread that's resuming other deliveries.
    It would be better to not run the delivery within the same call. Hence the change here is simple, being just using a connection.runLater instead of runNow.
    I have seen this on a thread dump from a production server.
    No semantic issues were encountered but there was a theory that the Netty thread responsible to resume would be busy with a delivery when not supposed to.
    Better to be safe on this case.
---
 .../activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java
index d6fccce451..b2cffb483b 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java
@@ -166,7 +166,7 @@ public class AMQPLargeMessageWriter implements MessageWriter {
     * Used to provide re-entry from the flow control executor when IO back-pressure has eased
     */
    private void resume() {
-      connection.runNow(this::tryDelivering);
+      connection.runLater(this::tryDelivering);
    }
 
    private void tryDelivering() {