This is an automated email from the ASF dual-hosted git repository.
jiangtian pushed a commit to branch native_raft
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/native_raft by this push:
new 0bfbec1c5a print remaining disaptcher number
0bfbec1c5a is described below
commit 0bfbec1c5adcfe5df21e1ff85d6a4d345442bffa
Author: Tian Jiang <[email protected]>
AuthorDate: Wed Apr 19 11:27:16 2023 +0800
print remaining disaptcher number
---
.../natraft/protocol/log/dispatch/DispatcherThread.java | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git
a/consensus/src/main/java/org/apache/iotdb/consensus/natraft/protocol/log/dispatch/DispatcherThread.java
b/consensus/src/main/java/org/apache/iotdb/consensus/natraft/protocol/log/dispatch/DispatcherThread.java
index 7e45c26f8a..e571d57cb4 100644
---
a/consensus/src/main/java/org/apache/iotdb/consensus/natraft/protocol/log/dispatch/DispatcherThread.java
+++
b/consensus/src/main/java/org/apache/iotdb/consensus/natraft/protocol/log/dispatch/DispatcherThread.java
@@ -147,12 +147,14 @@ class DispatcherThread implements Runnable {
} catch (Exception e) {
logger.error("Unexpected error in log dispatcher", e);
}
- logger.info(
- "Dispatcher exits, idle ratio: {}, running time: {}ms, idle time:
{}ms",
- idleTimeSum * 1.0 / (idleTimeSum + runningTimeSum),
- runningTimeSum / 1_000_000L,
- idleTimeSum / 1_000_000L);
- group.getGroupThreadNum().decrementAndGet();
+ if (runningTimeSum > 0) {
+ logger.info(
+ "Dispatcher exits, idle ratio: {}, running time: {}ms, idle time:
{}ms, remaining threads: {}",
+ idleTimeSum * 1.0 / (idleTimeSum + runningTimeSum),
+ runningTimeSum / 1_000_000L,
+ idleTimeSum / 1_000_000L,
+ group.getGroupThreadNum().decrementAndGet());
+ }
}
protected void serializeEntries() throws InterruptedException {