keith-turner commented on pull request #2340:
URL: https://github.com/apache/accumulo/pull/2340#issuecomment-959157451


   If the goal of this change is to make it so that Accumulo client code never 
has to catch Error, then this change will not completely achieve that goal.  
Anytime we use Future or CompletableFuture w/ a thread pool we will still be 
catching Throwable indirectly via java Future code.  The java Future code wraps 
task submitted to the thread pool with code that catches Throwable, so the 
thread pool itself will never see errors.
   
   For example the following code calls `supplyAsync()` which queues a 
CompletableFuture task on `executor`. The queued task will catch throwable and 
the executor would never see any errors.
   
   
https://github.com/apache/accumulo/blob/785a3645261571f000a7adb3c7c72b07886f0587/core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/BulkImport.java#L544-L563
   
   If an error did occur the following code would see it wrapped in an 
ExecutionException and then wrap that in a RuntimeException and punt it back to 
the user.  So we would still be catching Errors in the Accumulo client code, 
unless we stop using Java futures.
   
   
https://github.com/apache/accumulo/blob/785a3645261571f000a7adb3c7c72b07886f0587/core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/BulkImport.java#L577-L579
   


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