Restore dedicated thread pool for include scanning in async execution. Include scanning (`IncludeParser`) is predominantly a CPU-bound workload (regex and token parsing over C++ headers) rather than I/O-bound. Virtual threads do not unmount from carrier threads during CPU-intensive processing, which can monopolize the JVM carrier thread pool (`ForkJoinPool`) and starve other async tasks under high concurrency. This change restores the dedicated bounded platform thread pool (`options.getIncludeScanningParallelism()`) for include scanning in async execution to properly bound CPU concurrency. PiperOrigin-RevId: 971878996 Change-Id: I053f071eee970f4c06136b8b8850098edc87e87c
diff --git a/src/main/java/com/google/devtools/build/lib/includescanning/IncludeScanningModule.java b/src/main/java/com/google/devtools/build/lib/includescanning/IncludeScanningModule.java index 6b1c8f9..9a2d247 100644 --- a/src/main/java/com/google/devtools/build/lib/includescanning/IncludeScanningModule.java +++ b/src/main/java/com/google/devtools/build/lib/includescanning/IncludeScanningModule.java
@@ -67,7 +67,6 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; import java.util.concurrent.SynchronousQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; @@ -323,13 +322,8 @@ @Override public void executorCreated() { - var useAsyncExecution = useAsyncExecution(env); int threads = options.getIncludeScanningParallelism(); - if (useAsyncExecution) { - includePool = - Executors.newThreadPerTaskExecutor( - Thread.ofVirtual().name("Include scanner ", 0).factory()); - } else if (threads > 0) { + if (threads > 0) { logger.atInfo().log("Include scanning configured to use a pool with %d threads", threads); if (options.getExperimentalReuseIncludeScanningThreads()) { includePool =