Skip to content

Commit e4c2c76

Browse files
committed
better logger
1 parent b482afa commit e4c2c76

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/PipeDataNodeTaskAgent.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,8 @@ public void persistAllProgressIndex2ConfigNode() {
619619
IoTDBDescriptor.getInstance().getConfig().getDataNodeId(), resp);
620620
if (TSStatusCode.SUCCESS_STATUS.getStatusCode() != result.getCode()) {
621621
LOGGER.warn("Failed to persist progress index to configNode, status: {}", result);
622+
} else {
623+
LOGGER.info("Successfully persisted all pipe's info to configNode.");
622624
}
623625
} catch (final Exception e) {
624626
LOGGER.warn(e.getMessage());

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/DataNodeShutdownHook.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,16 @@ public void run() {
9696
if (PipeDataNodeAgent.task().getPipeCount() != 0) {
9797
for (Map.Entry<String, PipeDataNodeRemainingEventAndTimeOperator> entry :
9898
PipeDataNodeSinglePipeMetrics.getInstance().remainingEventAndTimeOperatorMap.entrySet()) {
99-
while (entry.getValue().getRemainingNonHeartbeatEvents() > 0) {
99+
boolean timeout = false;
100+
while (true) {
101+
if (entry.getValue().getRemainingNonHeartbeatEvents() > 0) {
102+
logger.info(
103+
"Successfully waited for pipe {} to finish.", entry.getValue().getPipeName());
104+
break;
105+
}
100106
if (System.currentTimeMillis() - startTime
101107
> PipeConfig.getInstance().getPipeMaxWaitFinishTime()) {
108+
timeout = true;
102109
break;
103110
}
104111
try {
@@ -108,6 +115,10 @@ public void run() {
108115
logger.info("Interrupted when waiting for pipe to finish");
109116
}
110117
}
118+
if (timeout) {
119+
logger.info("Timed out when waiting for pipes to finish, will break");
120+
break;
121+
}
111122
}
112123
}
113124
// Persist progress index before shutdown to accurate recovery after restart

0 commit comments

Comments
 (0)