nfsantos commented on code in PR #2031:
URL: https://github.com/apache/jackrabbit-oak/pull/2031#discussion_r1957784902


##########
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/DocumentStoreIndexerBase.java:
##########
@@ -413,12 +413,13 @@ public void reindex() throws CommitFailedException, 
IOException {
                         }
                     }
                     log.info("Top slowest nodes to index (ms): {}", 
slowestTopKElements);
+                }
 
-                    indexerProviders.forEach(indexProvider -> {
-                        ExtractedTextCache extractedTextCache = 
indexProvider.getTextCache();
-                        CacheStats cacheStats = extractedTextCache == null ? 
null : extractedTextCache.getCacheStats();
-                        log.info("Text extraction cache statistics: {}", 
cacheStats == null ? "N/A" : cacheStats.cacheInfoAsString());
-                    });
+                for (NodeStateIndexerProvider indexerProvider : 
indexerProviders) {
+                    indexerProvider.close();

Review Comment:
   Good point, it's a bad practise to access an object after closing it. I 
moved the close to the end of the block. 



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

Reply via email to