force exit on double SIGINT

Fixes #7918
This commit is contained in:
Joao Duarte 2017-08-08 16:30:28 +01:00 committed by João Duarte
parent 97f5537828
commit a9218daa65
2 changed files with 1 additions and 16 deletions

View file

@ -190,13 +190,6 @@ class LogStash::Agent
converge_result
end
def force_shutdown!
stop_collecting_metrics
stop_webserver
transition_to_stopped
force_shutdown_pipelines!
end
def id
return @id if @id
@ -427,13 +420,6 @@ class LogStash::Agent
@collect_metric
end
def force_shutdown_pipelines!
@pipelines.each do |_, pipeline|
# TODO(ph): should it be his own action?
pipeline.force_shutdown!
end
end
def shutdown_pipelines
logger.debug("Shutting down all pipelines", :pipelines_count => pipelines_count)

View file

@ -468,8 +468,7 @@ class LogStash::Runner < Clamp::StrictCommand
Stud::trap("INT") do
if @interrupted_once
logger.fatal(I18n.t("logstash.agent.forced_sigint"))
@agent.force_shutdown!
exit
exit(1)
else
logger.warn(I18n.t("logstash.agent.sigint"))
Thread.new(logger) {|lg| sleep 5; lg.warn(I18n.t("logstash.agent.slow_shutdown")) }