You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/02/09 13:18:40 UTC

[GitHub] [nifi] Lehel44 commented on a change in pull request #4812: NIFI-8210: When Index Reader/Searcher is used, do not allow the Lucen…

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:
users@infra.apache.org