deniskuzZ commented on a change in pull request #1275:
URL: https://github.com/apache/hive/pull/1275#discussion_r458624026
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Initiator.java
##########
@@ -182,6 +197,10 @@ public void run() {
} catch (Throwable t) {
LOG.error("Caught an exception in the main loop of compactor initiator,
exiting " +
StringUtils.stringifyException(t));
+ } finally {
+ if (compactionExecutor != null) {
+ compactionExecutor.shutdownNow();
Review comment:
what's the reasoning behind this?
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Initiator.java
##########
@@ -149,17 +156,25 @@ public void run() {
String runAs = resolveUserToRunAs(tblNameOwners, t, p);
/* checkForCompaction includes many file metadata checks and may
be expensive.
* Therefore, using a thread pool here and running
checkForCompactions in parallel */
-
compactionList.add(CompletableFuture.runAsync(ThrowingRunnable.unchecked(() ->
- scheduleCompactionIfRequired(ci, t, p, runAs)),
compactionExecutor));
+ completionService.submit(() -> {
+ ThrowingRunnable.unchecked(() ->
scheduleCompactionIfRequired(ci, t, p, runAs));
+ return null;
+ });
+ count++;
} catch (Throwable t) {
LOG.error("Caught exception while trying to determine if we
should compact {}. " +
"Marking failed to avoid repeated failures, {}", ci, t);
ci.errorMessage = t.getMessage();
txnHandler.markFailed(ci);
}
}
- CompletableFuture.allOf(compactionList.toArray(new
CompletableFuture[0]))
- .join();
+ for(int i=0; i<count; i++) {
Review comment:
What's the reasoning behind this change?
----------------------------------------------------------------
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]