You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flume.apache.org by GitBox <gi...@apache.org> on 2022/04/15 23:18:30 UTC

[GitHub] [flume] tmgstevens commented on a diff in pull request #367: [FLUME-3423]:Taildir source will throw unnecessay exception when rest…

tmgstevens commented on code in PR #367:
URL: https://github.com/apache/flume/pull/367#discussion_r851552888


##########
flume-ng-sources/flume-taildir-source/src/main/java/org/apache/flume/source/taildir/ReliableTaildirEventReader.java:
##########
@@ -92,8 +92,11 @@ private ReliableTaildirEventReader(Map<String, String> filePaths,
     this.fileNameHeader = fileNameHeader;
     updateTailFiles(skipToEnd);
 
-    logger.info("Updating position from position file: " + positionFilePath);
-    loadPositionFile(positionFilePath);
+    File positionFile = new File(positionFilePath);
+    if (positionFile.exists() && positionFile.isFile() && positionFile.length() != 0) {
+      logger.info("Updating position from position file: " + positionFilePath);
+      loadPositionFile(positionFilePath);
+    }

Review Comment:
   Perhaps we should log a warning in the else condition?



-- 
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: dev-unsubscribe@flume.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org