diff --git a/logstash-core/lib/logstash/pipeline_action/stop.rb b/logstash-core/lib/logstash/pipeline_action/stop.rb index 79298b7e4..7ee45f76a 100644 --- a/logstash-core/lib/logstash/pipeline_action/stop.rb +++ b/logstash-core/lib/logstash/pipeline_action/stop.rb @@ -14,6 +14,7 @@ module LogStash module PipelineAction def execute(agent, pipelines) pipeline = pipelines[pipeline_id] pipeline.shutdown { LogStash::ShutdownWatcher.start(pipeline) } + pipeline.thread.join pipelines.delete(pipeline_id) # If we reach this part of the code we have succeeded because # the shutdown call will block.