bhabegger commented on code in PR #2679:
URL: https://github.com/apache/jackrabbit-oak/pull/2679#discussion_r2685779619


##########
oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/ExtractedTextCache.java:
##########
@@ -346,26 +344,7 @@ private synchronized void createExecutor() {
             return;
         }
         log.debug("ExtractedTextCache createExecutor {}", this);
-        ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 
EXTRACTION_MAX_THREADS,
-                60L, TimeUnit.SECONDS,
-            new LinkedBlockingQueue<>(), new ThreadFactory() {
-            private final AtomicInteger counter = new AtomicInteger();
-            private final Thread.UncaughtExceptionHandler handler = (t, e) -> 
log.warn("Error occurred in asynchronous processing ", e);
-            @Override
-            public Thread newThread(@NotNull Runnable r) {
-                Thread thread = new Thread(r, createName());
-                thread.setDaemon(true);
-                thread.setPriority(Thread.MIN_PRIORITY);
-                thread.setUncaughtExceptionHandler(handler);
-                return thread;
-            }
-
-            private String createName() {
-                int index = counter.getAndIncrement();
-                return "oak binary text extractor" + (index == 0 ? "" : " " + 
index);
-            }
-        });
-        executor.setKeepAliveTime(1, TimeUnit.MINUTES);
+        ThreadPoolExecutor executor = 
ExecutorHelper.linkedQueueExecutor(EXTRACTION_MAX_THREADS, 
"oak-binary-text-extractor-%d", (t, e) -> log.warn("Error occurred in 
asynchronous processing ", e));

Review Comment:
   Here we again have the same behavior as before, only 1 thread all the time. 



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