SteveYurongSu commented on code in PR #14049:
URL: https://github.com/apache/iotdb/pull/14049#discussion_r1837432190
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/tsfile/PipeTsFileResourceManager.java:
##########
@@ -97,19 +97,19 @@ private void ttlCheck() throws InterruptedException {
if (entry.getValue().closeIfOutOfTimeToLive()) {
iterator.remove();
} else {
- logger.ifPresent(
- l ->
- l.info(
- "Pipe file (file name: {}) is still referenced {} times",
- entry.getKey(),
- entry.getValue().getReferenceCount()));
+ logBuilder.append(
+ String.format(
+ "<%s , %d times> ", entry.getKey(),
entry.getValue().getReferenceCount()));
}
} catch (final IOException e) {
LOGGER.warn("failed to close PipeTsFileResource when checking TTL: ",
e);
} finally {
segmentLock.unlock(new File(hardlinkOrCopiedFile));
}
}
+ if (logBuilder.length() > 0) {
+ logger.ifPresent(l -> l.info("Pipe file {}are still referenced",
logBuilder));
+ }
Review Comment:
```suggestion
} finally {
segmentLock.unlock(new File(hardlinkOrCopiedFile));
if (!logBuilder.isEmpth()) {
logger.ifPresent(l -> l.info("Pipe file {}are still referenced",
logBuilder));
}
}
}
```
--
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]