Jackie-Jiang commented on code in PR #11688:
URL: https://github.com/apache/pinot/pull/11688#discussion_r1337911460


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/service/SubmissionService.java:
##########
@@ -24,29 +24,30 @@
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import org.apache.pinot.common.exception.QueryException;
 
 
 /**
  * Submission service is used to submit multiple runnables and checks the 
result upon all {@link Future} returns
  * or any failure occurs.
  */
 public class SubmissionService {
-  private final ExecutorService _executor;
   private final List<CompletableFuture<Void>> _futures = new ArrayList<>();
 
-  public SubmissionService(ExecutorService executor) {
-    _executor = executor;
+  public SubmissionService() {
   }
 
-  public void submit(Runnable runnable) {
-    _futures.add(CompletableFuture.runAsync(runnable, _executor));
+  public void submit(Runnable runnable, ExecutorService executor) {
+    _futures.add(CompletableFuture.runAsync(runnable, executor));
   }
 
-  public void awaitFinish(long deadlineMs)
-      throws Exception {
+  public void awaitFinish(long deadlineMs) {
     CompletableFuture<Void> completableFuture = 
CompletableFuture.allOf(_futures.toArray(new CompletableFuture[]{}));
     try {
       completableFuture.get(deadlineMs - System.currentTimeMillis(), 
TimeUnit.MILLISECONDS);
+    } catch (Throwable t) {

Review Comment:
   Can this ever throw `Throwable`? Or is it always wrapped in 
`ExecutionException`?



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