elastic/logstash

LogStash should call shutdown hooks

Open

#5174 opened on Apr 22, 2016

View on GitHub
 (2 comments) (0 reactions) (0 assignees)Ruby (14,197 stars) (3,496 forks)batch import
bughelp wanted

Description

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.

Contributor guide