HBASE-19822 HFileCleaner threads stick around after shutdown stuck on queue#take Interrupt wait on queue when cancel is called.

This commit is contained in:
Michael Stack 2018-01-18 11:12:31 -08:00
parent cde1f821eb
commit 8b520ce50d
1 changed files with 9 additions and 1 deletions

View File

@ -231,7 +231,7 @@ public class HFileCleaner extends CleanerChore<BaseHFileCleanerDelegate> {
try {
task = queue.take();
} catch (InterruptedException e) {
LOG.debug("Interrupted while trying to take a task from queue", e);
LOG.trace("Interrupted while trying to take a task from queue", e);
break;
}
if (task != null) {
@ -445,4 +445,12 @@ public class HFileCleaner extends CleanerChore<BaseHFileCleanerDelegate> {
}
return updated;
}
@Override
public synchronized void cancel(boolean mayInterruptIfRunning) {
super.cancel(mayInterruptIfRunning);
for (Thread t: this.threads) {
t.interrupt();
}
}
}