|
@@ -1312,6 +1312,10 @@ class BPServiceActor implements Runnable {
|
|
|
processQueue();
|
|
|
} catch (Throwable t) {
|
|
|
LOG.error("{} encountered fatal exception and exit.", getName(), t);
|
|
|
+ runningState = RunningState.FAILED;
|
|
|
+ } finally {
|
|
|
+ LOG.warn("Ending command processor service for: " + this);
|
|
|
+ shouldServiceRun = false;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1327,6 +1331,7 @@ class BPServiceActor implements Runnable {
|
|
|
dn.getMetrics().incrNumProcessedCommands();
|
|
|
} catch (InterruptedException e) {
|
|
|
LOG.error("{} encountered interrupt and exit.", getName());
|
|
|
+ Thread.currentThread().interrupt();
|
|
|
// ignore unless thread was specifically interrupted.
|
|
|
if (Thread.interrupted()) {
|
|
|
break;
|
|
@@ -1398,4 +1403,11 @@ class BPServiceActor implements Runnable {
|
|
|
dn.getMetrics().incrActorCmdQueueLength(1);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @VisibleForTesting
|
|
|
+ void stopCommandProcessingThread() {
|
|
|
+ if (commandProcessingThread != null) {
|
|
|
+ commandProcessingThread.interrupt();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|