areyouok commented on a change in pull request #3631:
URL: https://github.com/apache/rocketmq/pull/3631#discussion_r767168855
##########
File path:
broker/src/main/java/org/apache/rocketmq/broker/processor/SendMessageProcessor.java
##########
@@ -84,7 +84,7 @@ public RemotingCommand processRequest(ChannelHandlerContext
ctx,
@Override
public void asyncProcessRequest(ChannelHandlerContext ctx, RemotingCommand
request, RemotingResponseCallback responseCallback) throws Exception {
- asyncProcessRequest(ctx,
request).thenAcceptAsync(responseCallback::callback,
this.brokerController.getSendMessageExecutor());
+ asyncProcessRequest(ctx,
request).thenAcceptAsync(responseCallback::callback,
this.brokerController.getPutMessageFutureExecutor());
Review comment:
The callback is an async netty operation (ctx.writeAndFlush). I suggest
use thenAccept() method, the writeAndFlush may run in these threads:
1. sendMessageExecutor
2. the flush thread
3. the transfer thread
Or use a single thread executor.
##########
File path:
broker/src/main/java/org/apache/rocketmq/broker/processor/SendMessageProcessor.java
##########
@@ -84,7 +84,7 @@ public RemotingCommand processRequest(ChannelHandlerContext
ctx,
@Override
public void asyncProcessRequest(ChannelHandlerContext ctx, RemotingCommand
request, RemotingResponseCallback responseCallback) throws Exception {
- asyncProcessRequest(ctx,
request).thenAcceptAsync(responseCallback::callback,
this.brokerController.getSendMessageExecutor());
+ asyncProcessRequest(ctx,
request).thenAcceptAsync(responseCallback::callback,
this.brokerController.getPutMessageFutureExecutor());
Review comment:
The callback is an async netty operation (ctx.writeAndFlush). I suggest
use thenAccept() method, the writeAndFlush may run in these threads:
1. sendMessageExecutor
2. the flush thread
3. the transfer thread
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]