lizhimins commented on code in PR #9137:
URL: https://github.com/apache/rocketmq/pull/9137#discussion_r1936693286
##########
client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java:
##########
@@ -777,8 +777,14 @@ private SendResult sendDefaultImpl(
callTimeout = true;
break;
}
-
- sendResult = this.sendKernelImpl(msg, mq,
communicationMode, sendCallback, topicPublishInfo, timeout - costTime);
+ long curTimeout = timeout - costTime;
+ // In order to prevent the broker from being
unresponsive for a long time and thus being unable to retry next time,
+ // if there is another chance for retry next time, the
maximum sending time is modified to the maximum sendMsgMaxTimeoutPerRequest.
+ if (defaultMQProducer.getSendMsgMaxTimeoutPerRequest()
> -1 && times + 1 < timesTotal
Review Comment:
Extracting variables may make the code readable
--
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]