Vladsz83 commented on code in PR #13497:
URL: https://github.com/apache/ignite/pull/13497#discussion_r3819231393


##########
modules/core/src/main/java/org/apache/ignite/internal/management/cache/VerifyBackupPartitionsTask.java:
##########
@@ -94,15 +116,64 @@ public class VerifyBackupPartitionsTask extends 
ComputeTaskAdapter<CacheIdleVeri
     /** Checkpoint reason. */
     public static final String CP_REASON = "VerifyBackupPartitions";
 
-    /** Shared for tests. */
-    public static Supplier<ExecutorService> poolSupplier = 
IgniteForkJoinPool::commonPool;
+    /** Effective verify executor service. */
+    private static ExecutorService EXECUTOR_SERVICE;
 
     /** Injected logger. */
     @LoggerResource
     private IgniteLogger log;
 
-    /** */
-    private static final long serialVersionUID = 0L;
+    /** Initializes {@link #EXECUTOR_SERVICE}. */
+    public static ExecutorService initOrGetVerifyExecutor(String igniteName) {
+        if (EXECUTOR_SERVICE == null) {
+            synchronized (VerifyBackupPartitionsTask.class) {
+                if (EXECUTOR_SERVICE == null) {
+                    int maxPoolSz = 
IgniteSystemProperties.getInteger(VERIFY_POOL_SIZE, DFLT_VERIFY_POOL_SIZE);
+
+                    if (maxPoolSz < 1)
+                        throw new IgniteException(new 
IllegalArgumentException(VERIFY_POOL_SIZE + " must be greater than 0."));
+
+                    LinkedBlockingQueue<Runnable> actualJobQueue = new 
LinkedBlockingQueue<>();
+
+                    EXECUTOR_SERVICE = new IgniteThreadPoolExecutor(

Review Comment:
   ` IgniteUtils.doInParallel ` requires a pool too (`ExecutorService`), and we 
don't want to use FJP at all. The question is which one to choose. We wish the 
pool to be temporary. Stopped or shrinked after IdleVerify finished. No need to 
keep it. Unfortunatelly, current implementation of job execution and 
`ThreadPoolExecutor` (and `IgniteThreadPoolExecutor`) hinders that.  
`PoolProcessor` isn't the only place whe pools are kept. I'm not sure that 
speceific, temporary-by-nature pool should be placed there.



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