logstash/logstash — pull request #1083 by cmertz (2014-02-18 12:43:35+00:00)
Title: explicitly close IO instance after read

The exec input plugin currently relies on GC to autoclose files associated with IO instances. This can lead to the open file limit beeing reached before the IOs are closed and the plugin to stop working.

The behaviour can easily be reproduced by using an exec input with a low interval and count open files of the logstash process.

example log entry:
{:timestamp=>"2013-11-19T23:03:05.025000+0100", :message=>"A plugin had an unrecoverable error. Will restart this plugin.\n Plugin: \"system-memory-usage\", command=>\"free -b | grep Mem | awk '{print $3/$2*100}'\">\n Error: Cannot run program \"/bin/sh\" (in directory \"/\"): java.io.IOException: error=24, Too many open files", :level=>:error}