sashapolo commented on code in PR #4190:
URL: https://github.com/apache/ignite-3/pull/4190#discussion_r1705955128


##########
modules/replicator/src/test/java/org/apache/ignite/internal/replicator/ReplicaManagerTest.java:
##########
@@ -109,12 +109,15 @@ void startReplicaManager(
 
         var clock = new HybridClockImpl();
 
-        requestsExecutor = new ThreadPoolExecutor(
-                0, 5,
-                0, TimeUnit.SECONDS,
+        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
+                5, 5,
+                10, TimeUnit.SECONDS,
                 new LinkedBlockingQueue<>(),
                 NamedThreadFactory.create(nodeName, "partition-operations", 
log)
         );
+        threadPoolExecutor.allowCoreThreadTimeOut(true);

Review Comment:
   Same question, I don't think we need to shutdown threads preemptively in 
tests



##########
modules/replicator/src/integrationTest/java/org/apache/ignite/internal/replicator/ItPlacementDriverReplicaSideTest.java:
##########
@@ -152,12 +152,15 @@ public class ItPlacementDriverReplicaSideTest extends 
IgniteAbstractTest {
 
     @BeforeEach
     public void beforeTest(TestInfo testInfo) {
-        partitionOperationsExecutor = new ThreadPoolExecutor(
-                0, 20,
-                0, TimeUnit.SECONDS,
+        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
+                20, 20,

Review Comment:
   Do we really need 20 threads in tests?



##########
modules/replicator/src/integrationTest/java/org/apache/ignite/internal/replicator/ItPlacementDriverReplicaSideTest.java:
##########
@@ -152,12 +152,15 @@ public class ItPlacementDriverReplicaSideTest extends 
IgniteAbstractTest {
 
     @BeforeEach
     public void beforeTest(TestInfo testInfo) {
-        partitionOperationsExecutor = new ThreadPoolExecutor(
-                0, 20,
-                0, TimeUnit.SECONDS,
+        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
+                20, 20,
+                10, TimeUnit.SECONDS,
                 new LinkedBlockingQueue<>(),
                 NamedThreadFactory.create("test", "partition-operations", log)
         );
+        threadPoolExecutor.allowCoreThreadTimeOut(true);

Review Comment:
   Why do we need this here?



##########
modules/network/src/main/java/org/apache/ignite/internal/network/netty/ConnectionManager.java:
##########
@@ -218,16 +218,19 @@ public ConnectionManager(
 
         this.clientBootstrap = bootstrapFactory.createClientBootstrap();
 
-        // We don't just use Executors#newSingleThreadExecutor() here because 
it defines corePoolSize=1, so the maintenance thread will
+        // We don't just use Executors#newSingleThreadExecutor() here because 
the maintenance thread will
         // be kept alive forever, and we only need it from time to time, so it 
seems a waste to keep the thread alive.
-        connectionMaintenanceExecutor = new ThreadPoolExecutor(
-                0,
+        ThreadPoolExecutor maintenanceExecutor = new ThreadPoolExecutor(

Review Comment:
   Can we use `singleThreadExecutor` now, since we are using 
`allowCoreThreadTimeOut`?



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