logstash-plugins/logstash-filter-grok

Thread leak on reload

jakelandis opened this issue · 2 comments

When a pipeline is reloaded the timeout enforcer thread is leaked across reloads. The thread should be stopped on reload.

Profiling with the following configuration:

input { generator { message => "hello"} } 
filter { grok { match => {"message" => "%{WORD:greeting}"}}}
output { null{} }      	   

Upon each reload (-r) a new thread is created, but not destroyed.
image

This is a bit tricky... it isn't that the thread isn't getting joined/stopped on reload (it is)...it is a bug in Logstash core that is calling initialize twice, and only 1/2 created threads are getting cleaned up. I will log a bug there soon.

For example, after 1 reload (note showing live and finished):
image

....and after 2 reloads
image

Root cause: elastic/logstash#8902.

Will close this issue since there is nothing to be done from this plugin, and this a symptom of a larger problem that can affect many different plugins.