pvary commented on a change in pull request #1275:
URL: https://github.com/apache/hive/pull/1275#discussion_r457977709



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Cleaner.java
##########
@@ -89,9 +94,12 @@ public void run() {
         handle = 
txnHandler.getMutexAPI().acquireLock(TxnStore.MUTEX_KEY.Cleaner.name());
         startedAt = System.currentTimeMillis();
         long minOpenTxnId = txnHandler.findMinOpenTxnIdForCleaner();
+        List<CompletableFuture> cleanerList = new ArrayList<>();
         for(CompactionInfo compactionInfo : txnHandler.findReadyToClean()) {
-          clean(compactionInfo, minOpenTxnId);
+          
cleanerList.add(CompletableFuture.runAsync(ThrowingRunnable.unchecked(() ->
+            clean(compactionInfo, minOpenTxnId)), cleanerExecutor));
         }
+        CompletableFuture.allOf(cleanerList.toArray(new 
CompletableFuture[0])).join();

Review comment:
       What happens if one of the futures throws the exception?
   Are the others continue to execute? Will we wait until all of the tasks are 
finished one way or another?
   We do not want multiple Cleaning tasks running concurrently on the same 
partition.
   
   Seeing this the same problem might arise with the Initiator too. What do you 
think @deniskuzZ ?




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

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