wait for pipeline thread to end before returning from the stop action

This commit is contained in:
Colin Surprenant 2017-08-30 12:16:45 -04:00
parent f722d23e80
commit 825da10cbb

View file

@ -14,6 +14,7 @@ module LogStash module PipelineAction
def execute(agent, pipelines) def execute(agent, pipelines)
pipeline = pipelines[pipeline_id] pipeline = pipelines[pipeline_id]
pipeline.shutdown { LogStash::ShutdownWatcher.start(pipeline) } pipeline.shutdown { LogStash::ShutdownWatcher.start(pipeline) }
pipeline.thread.join
pipelines.delete(pipeline_id) pipelines.delete(pipeline_id)
# If we reach this part of the code we have succeeded because # If we reach this part of the code we have succeeded because
# the shutdown call will block. # the shutdown call will block.