From 9c8fdb715f774440009b85da2edbd2ab0278831d Mon Sep 17 00:00:00 2001 From: Humkum <1109939087@qq.com> Date: Fri, 24 May 2024 17:01:41 +0800 Subject: [PATCH] [ISSUE #8168] fix: There's no need to retry when async produce already timeout (#8169) --- .../org/apache/rocketmq/client/impl/MQClientAPIImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java b/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java index 9b15279cb62..816ae877aca 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java @@ -704,9 +704,10 @@ public void operationFail(Throwable throwable) { onExceptionImpl(brokerName, msg, timeoutMillis - cost, request, sendCallback, topicPublishInfo, instance, retryTimesWhenSendFailed, times, ex, context, true, producer); } else { - MQClientException ex = new MQClientException("unknow reseaon", throwable); + MQClientException ex = new MQClientException("unknown reason", throwable); + boolean needRetry = !(throwable instanceof RemotingTooMuchRequestException); onExceptionImpl(brokerName, msg, timeoutMillis - cost, request, sendCallback, topicPublishInfo, instance, - retryTimesWhenSendFailed, times, ex, context, true, producer); + retryTimesWhenSendFailed, times, ex, context, needRetry, producer); } } });