JackieTien97 commented on code in PR #11372:
URL: https://github.com/apache/iotdb/pull/11372#discussion_r1372626307
##########
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/client/DispatchLogHandler.java:
##########
@@ -69,20 +70,22 @@ public void onComplete(TSyncLogEntriesRes response) {
logDispatcherThreadMetrics.recordSyncLogTimePerRequest(System.nanoTime() -
createTime);
}
- private boolean needRetry(int statusCode) {
+ public static boolean needRetry(int statusCode) {
return statusCode == TSStatusCode.INTERNAL_SERVER_ERROR.getStatusCode()
|| statusCode == TSStatusCode.SYSTEM_READ_ONLY.getStatusCode()
|| statusCode == TSStatusCode.WRITE_PROCESS_REJECT.getStatusCode();
}
@Override
public void onError(Exception exception) {
- logger.warn(
- "Can not send {} to peer for {} times {} because {}",
- batch,
- thread.getPeer(),
- ++retryCount,
- exception);
+ if (logger.isWarnEnabled()) {
+ logger.warn(
+ "Can not send {} to peer for {} times {} because {}",
+ batch,
+ thread.getPeer(),
+ ++retryCount,
Review Comment:
Good catch! I will move it outside.
--
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]