Skip to content

Commit c1ccc3c

Browse files
authored
[ISSUE #9914] Simplify isolation logic when updating fault item in sendKernelImpl (#9915)
1 parent 6fa05ff commit c1ccc3c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -816,13 +816,9 @@ private SendResult sendDefaultImpl(
816816
continue;
817817
} catch (RemotingException e) {
818818
endTimestamp = System.currentTimeMillis();
819-
if (this.mqFaultStrategy.isStartDetectorEnable()) {
820-
// Set this broker unreachable when detecting schedule task is running for RemotingException.
821-
this.updateFaultItem(mq.getBrokerName(), endTimestamp - beginTimestampPrev, true, false);
822-
} else {
823-
// Otherwise, isolate this broker.
824-
this.updateFaultItem(mq.getBrokerName(), endTimestamp - beginTimestampPrev, true, true);
825-
}
819+
// Set this broker unreachable when detecting schedule task is running for RemotingException.
820+
// Otherwise, isolate this broker.
821+
this.updateFaultItem(mq.getBrokerName(), endTimestamp - beginTimestampPrev, true, !this.mqFaultStrategy.isStartDetectorEnable());
826822
log.warn("sendKernelImpl exception, resend at once, InvokeID: {}, RT: {}ms, Broker: {}", invokeID, endTimestamp - beginTimestampPrev, mq, e);
827823
if (log.isDebugEnabled()) {
828824
log.debug(msg.toString());

0 commit comments

Comments
 (0)