mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
- Pipeline now calls teardown on all input plugins when shutdown is
requested - Make udp input plugin abort when shutdown signal is given. (LOGSTASH-1290)
This commit is contained in:
parent
e2faca1b36
commit
a9bb8689e2
3 changed files with 13 additions and 2 deletions
|
@ -1,5 +1,8 @@
|
||||||
1.2.2 (???)
|
1.2.2 (???)
|
||||||
# general
|
# general
|
||||||
|
## inputs
|
||||||
|
- bugfix: udp: respects teardown requests (via SIGINT) (LOGSTASH-1290)
|
||||||
|
|
||||||
## filters
|
## filters
|
||||||
- bugfix: geoip: empty values (nil, empty string) are not put into the event
|
- bugfix: geoip: empty values (nil, empty string) are not put into the event
|
||||||
anymore.
|
anymore.
|
||||||
|
|
|
@ -37,6 +37,8 @@ class LogStash::Inputs::Udp < LogStash::Inputs::Base
|
||||||
begin
|
begin
|
||||||
# udp server
|
# udp server
|
||||||
udp_listener(output_queue)
|
udp_listener(output_queue)
|
||||||
|
rescue LogStash::ShutdownSignal
|
||||||
|
# do nothing, shutdown was requested.
|
||||||
rescue => e
|
rescue => e
|
||||||
@logger.warn("UDP listener died", :exception => e, :backtrace => e.backtrace)
|
@logger.warn("UDP listener died", :exception => e, :backtrace => e.backtrace)
|
||||||
sleep(5)
|
sleep(5)
|
||||||
|
@ -63,8 +65,6 @@ class LogStash::Inputs::Udp < LogStash::Inputs::Base
|
||||||
output_queue << event
|
output_queue << event
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
rescue LogStash::ShutdownSignal
|
|
||||||
# shutdown
|
|
||||||
ensure
|
ensure
|
||||||
if @udp
|
if @udp
|
||||||
@udp.close_read rescue nil
|
@udp.close_read rescue nil
|
||||||
|
@ -72,4 +72,9 @@ class LogStash::Inputs::Udp < LogStash::Inputs::Base
|
||||||
end
|
end
|
||||||
end # def udp_listener
|
end # def udp_listener
|
||||||
|
|
||||||
|
public
|
||||||
|
def teardown
|
||||||
|
@udp.close if @udp && !@udp.closed?
|
||||||
|
end
|
||||||
|
|
||||||
end # class LogStash::Inputs::Udp
|
end # class LogStash::Inputs::Udp
|
||||||
|
|
|
@ -227,6 +227,9 @@ class LogStash::Pipeline
|
||||||
thread.wakeup # in case it's in blocked IO or sleeping
|
thread.wakeup # in case it's in blocked IO or sleeping
|
||||||
rescue ThreadError
|
rescue ThreadError
|
||||||
end
|
end
|
||||||
|
@inputs.each do |input|
|
||||||
|
input.teardown
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# No need to send the ShutdownSignal to the filters/outputs nor to wait for
|
# No need to send the ShutdownSignal to the filters/outputs nor to wait for
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue