elastic / logstash

Logstash - transport and process your logs, events, or other data
https://www.elastic.co/products/logstash
Other
14.16k stars 3.49k forks source link

LogStash should call shutdown hooks #5174

Open nukemberg opened 8 years ago

nukemberg commented 8 years ago

Currently, LogStash will shutdown by waiting for events to flush out and then call do_close on plugins. If --allow-unsafe-shutdown is specified then LogStash shutdown watcher will call Kernel.exit after some time.

However, ZeroMQ plugins will block under certain condition (this is by design of ZeroMQ), thus events will never flush out and do_close will never be called. The way to unblock the sockets is by terminating the ZeroMQ context. This can be done allowing a shutdown hook to be called before exiting forcefully.

nukemberg commented 8 years ago

Reference: https://github.com/logstash-plugins/logstash-mixin-zeromq/issues/3

jrgns commented 8 years ago

I think this is related? logstash-plugins/logstash-output-cloudwatch#9