Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIVE-28240: Compaction requests remain in Working state after Timeout… #5230

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public class Worker extends RemoteCompactorThread implements MetaStoreThread {

private String workerName;
private final CompactorFactory compactorFactory;
private CompactionInfo ci;

public Worker() {
compactorFactory = CompactorFactory.getInstance();
Expand Down Expand Up @@ -99,15 +100,16 @@ public void run() {
try {
launchedJob = singleRun.get(timeout, TimeUnit.MILLISECONDS);
} catch (TimeoutException te) {
LOG.info("Timeout during executing compaction", te);
LOG.error("Timeout during executing compaction", te);
// Cancel the job, and recreate the Executor as well, so we can be sure that we have an available thread
// even if we can not interrupt the task somehow. (Trade possible resource hogging for compactor stability)
singleRun.cancel(true);
markFailed(ci, "Timeout during executing compaction");
executor.shutdownNow();
executor = getTimeoutHandlingExecutor();
err = true;
} catch (ExecutionException e) {
LOG.info("Exception during executing compaction", e);
LOG.error("Exception during executing compaction", e);
err = true;
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
Expand Down Expand Up @@ -182,7 +184,6 @@ protected Boolean findNextCompactionAndExecute(boolean collectGenericStats, bool
// so wrap it in a big catch Throwable statement.
PerfLogger perfLogger = SessionState.getPerfLogger(false);
String workerMetric = null;
CompactionInfo ci = null;
Table table = null;
CompactionService compactionService = null;
boolean compactionResult = false;
Expand Down
Loading