Merge pull request #84 from rankinc/lease-renewal-threads
Always shutdown leaseRenewalThreadpool on exit.
This commit is contained in:
commit
d695c0ab80
1 changed files with 9 additions and 9 deletions
|
|
@ -80,7 +80,7 @@ public class LeaseCoordinator<T extends Lease> {
|
|||
protected final IMetricsFactory metricsFactory;
|
||||
|
||||
private ScheduledExecutorService leaseCoordinatorThreadPool;
|
||||
private ExecutorService leaseRenewalThreadpool;
|
||||
private final ExecutorService leaseRenewalThreadpool;
|
||||
private volatile boolean running = false;
|
||||
|
||||
/**
|
||||
|
|
@ -290,7 +290,6 @@ public class LeaseCoordinator<T extends Lease> {
|
|||
leaseTaker.getWorkerIdentifier()));
|
||||
} else {
|
||||
leaseCoordinatorThreadPool.shutdownNow();
|
||||
leaseRenewalThreadpool.shutdownNow();
|
||||
LOG.info(String.format("Worker %s stopped lease-tracking threads %dms after stop",
|
||||
leaseTaker.getWorkerIdentifier(),
|
||||
STOP_WAIT_TIME_MILLIS));
|
||||
|
|
@ -302,6 +301,7 @@ public class LeaseCoordinator<T extends Lease> {
|
|||
LOG.debug("Threadpool was null, no need to shutdown/terminate threadpool.");
|
||||
}
|
||||
|
||||
leaseRenewalThreadpool.shutdownNow();
|
||||
synchronized (shutdownLock) {
|
||||
leaseRenewer.clearCurrentlyHeldLeases();
|
||||
running = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue