sodonnel commented on a change in pull request #3168:
URL: https://github.com/apache/ozone/pull/3168#discussion_r823631760



##########
File path: 
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java
##########
@@ -1733,10 +1733,11 @@ public ExecutorService getECReconstructExecutor() {
           ecReconstructExecutor = new ThreadPoolExecutor(
               EC_RECONSTRUCT_STRIPE_READ_POOL_MIN_SIZE,
               clientConfig.getEcReconstructStripeReadPoolLimit(),
-              60, TimeUnit.SECONDS, new LinkedBlockingQueue<>(),
+              60, TimeUnit.SECONDS, new SynchronousQueue<>(),

Review comment:
       Why a SynchronousQueue? I have never used one of these before, so I did 
some research into it. I think that if all threads in the executor are busy, 
the task will fail to submit to the executor and fail with a 
`RejectedExecutionException`. I don't think this is good, as the exception 
would need to be handled at the caller and re-tried. Would a linked blocking 
queue with a capacity of say 1024 be more suitable? That way, we have a bounded 
queue and tasks should not fail due to unavailable threads.
   
   See this question and the accepted answer at the bottom:
   
   
https://stackoverflow.com/questions/44541784/synchronousqueue-does-not-block-when-offered-task-by-threadpoolexecutor




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to