-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Leak of scheduler thread under not catched errors in plugin run #21
Comments
The problem is that in https://github.com/elastic/logstash/blob/e9c9865f4066b54048f8d708612a72d25e2fe5d9/logstash-core/lib/logstash/java_pipeline.rb#L329-L358 if the
|
close method is used to clean in case of error in run phase of the plugin, implemented to avoid leak of threads generated by Rufus scheduler. Fixes logstash-plugins#21
close method is used to clean in case of error in run phase of the plugin, implemented to avoid leak of threads generated by Rufus scheduler. Fixes logstash-plugins#21 Close logstash-plugins#28
When Logstash during the start of a plugin is not able to catch all errors, like IO errors from the FS side, there is leakage of threads or resources.
This has been verified with
logstash-input-jdbc
with an IO error from redirected stdout and stderr of the Logstash process.The problem is that the jdbc input uses Rufus scheduler, and when the scheduler parses the schedule pattern (
* * * * *
)https://github.com/jmettraux/rufus-scheduler/blob/v3.0.9/lib/rufus/scheduler/cronline.rb#L77 it writes to stdout
warning: constant ::Fixnum is deprecated
, if in this step there is an IO error from the stdout the raised error make the pipeline to crash, but not to shutdown the LogStash process.Now if have the Logstash that uses the
xpack.management
we end in a situation where at every reload of the pipeline config from the remote we leak one thread.Steps to reproduce
jps
andjstack
tool to verify the rising of threadscreate limited size partition
/dev/loop<n>
:start a docker with ES and Kibana
use the attached docker compose file and start it:
docker-compose-monitoring-vs-management_without_LS.zip
configure main pipeline
Log into http://localhost:5601 with elastic/changeme , the management tab create a simple main pipeline (input { stdin {} } output {stdout {} })
configure Logstash and run it with stdout/stderr redirected
in Kibana configure the incriminated pipeline
jdbc_input
with this definition:Be sure to have
/tmp/input_script.sql
and the drivers, but it's not mandatory to have a running MySQL to trigger the buglogs/logstash-plain.log
to check to see this:use the
jps
andjstack
tool to verify the rising of threadsjps
to find Logstash pidjstack <pid>
or other monitor tool to see the increment of number of threadscleanup
The text was updated successfully, but these errors were encountered: