Clear the queue once the reader thread sees that it needs to stop.

Original commit: elastic/x-pack-elasticsearch@b70a224ff1
This commit is contained in:
Martijn van Groningen 2014-11-27 12:14:30 +01:00
parent 1cd5ae6a31
commit 27f83bb621
1 changed files with 1 additions and 1 deletions

View File

@ -132,7 +132,6 @@ public class AlertActionManager extends AbstractComponent {
public void stop() {
if (started.compareAndSet(true, false)) {
actionsToBeProcessed.clear();
actionsToBeProcessed.add(END_ENTRY);
logger.info("Stopped job queue");
}
@ -357,6 +356,7 @@ public class AlertActionManager extends AbstractComponent {
while (started()) {
AlertActionEntry entry = actionsToBeProcessed.take();
if (!started() || entry == END_ENTRY) {
actionsToBeProcessed.clear();
logger.info("Stopping thread to read from the job queue");
return;
}