diff options
author | Lester Solbakken <lesters@users.noreply.github.com> | 2023-06-12 22:19:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-12 22:19:43 +0200 |
commit | 5f25e0ba346c04ccc27c60cc410c0ed2fdb6b06b (patch) | |
tree | 34b94d063c20b17f1ef7926b980492a6ee514c1b /container-search | |
parent | 4de31ab2fa23f4e3ef51110a7270e9b2da170ace (diff) | |
parent | 8dbfc94b01ea4a2dc17bd35df3b49f279c2b07ab (diff) |
Merge pull request #27379 from vespa-engine/hmusum/always-log-if-failing-to-process-file
Always log when failing to process file
Diffstat (limited to 'container-search')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/logging/Spooler.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/logging/Spooler.java b/container-search/src/main/java/com/yahoo/search/logging/Spooler.java index e6d5bfc59ff..921b8f444f1 100644 --- a/container-search/src/main/java/com/yahoo/search/logging/Spooler.java +++ b/container-search/src/main/java/com/yahoo/search/logging/Spooler.java @@ -38,6 +38,7 @@ public class Spooler { private static final int defaultMaxEntriesPerFile = 100; // Maximum delay between first write to a file and when we should close file and move it for further processing static final Duration maxDelayAfterFirstWrite = Duration.ofSeconds(5); + private static final int maxFilesToRead = 50; private Path processingPath; private Path readyPath; @@ -89,7 +90,7 @@ public class Spooler { } log.log(Level.FINE, "Files in ready path: " + files.size()); - List<File> fileList = getFiles(files, 50); // TODO + List<File> fileList = getFiles(files); if ( ! fileList.isEmpty()) { processFiles(fileList, transport); } @@ -145,6 +146,8 @@ public class Spooler { if (failCount > maxFailures) { log.log(Level.WARNING, "Unable to process file " + file + " after trying " + maxFailures + " times, moving it to " + failuresPath); moveProcessedFile(file, failuresPath); + } else { + log.log(Level.INFO, "Unable to process file " + file + " after trying " + maxFailures + " times, will retry"); } } @@ -163,8 +166,8 @@ public class Spooler { public Path successesPath() { return successesPath; } public Path failuresPath() { return failuresPath; } - List<File> getFiles(List<Path> files, int count) { - Validation.requireAtLeast(count, "count must be a positive number", 1); + List<File> getFiles(List<Path> files) { + Validation.requireAtLeast(maxFilesToRead, "count must be a positive number", 1); List<File> fileList = new ArrayList<>(); for (Path p : files) { @@ -174,7 +177,7 @@ public class Spooler { } // Grab only some files - if (fileList.size() > count) { + if (fileList.size() > maxFilesToRead) { break; } } |