Skip to content

Commit

Permalink
ARTEMIS-4750 AMQP Large Message flow control to use runAfter
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
clebertsuconic committed May 1, 2024
1 parent 817dc41 commit 14e83fa
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public void writeBytes(MessageReference messageReference) {
* 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() {
Expand Down

0 comments on commit 14e83fa

Please sign in to comment.