Lehel44 commented on a change in pull request #4812:
URL: https://github.com/apache/nifi/pull/4812#discussion_r572875899



##########
File path: 
nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/index/lucene/LuceneCacheWarmer.java
##########
@@ -51,7 +52,14 @@ public void run() {
             for (final File indexDir : indexDirs) {
                 final long indexStartNanos = System.nanoTime();
 
-                final EventIndexSearcher eventSearcher = 
indexManager.borrowIndexSearcher(indexDir);
+                final EventIndexSearcher eventSearcher;
+                try {
+                    eventSearcher = indexManager.borrowIndexSearcher(indexDir);
+                } catch (final FileNotFoundException fnfe) {
+                    logger.debug("Cannot warm Lucene Index directory {} 
because the directory no longer exists", indexDir);
+                    continue;
+                }

Review comment:
       Hi, What do you think of extracting this nested try to a separate method?




----------------------------------------------------------------
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.

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


Reply via email to