From 5f6a390b6098dca1cfda09af4c0af096dfe736c0 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Wed, 15 Feb 2017 14:09:27 +0100 Subject: [PATCH] ARTEMIS-908: Ensure that connection lock is held when flushing --- .../artemis/protocol/amqp/broker/AMQPSessionCallback.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java index 36e08d9c745..18c6b05f17f 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java @@ -443,8 +443,10 @@ public void offerProducerCredit(final String address, final Receiver receiver) { try { if (address == null) { - receiver.flow(credits); - connection.flush(); + synchronized (connection.getLock()) { + receiver.flow(credits); + connection.flush(); + } return; } final PagingStore store = manager.getServer().getPagingManager().getPageStore(new SimpleString(address));