logstash-plugins / logstash-codec-multiline

Apache License 2.0
7 stars 31 forks source link

Fix: avoid long thread sleeps on codec close #67

Closed kares closed 3 years ago

kares commented 3 years ago

The PR fixes a stalled shutdown process due codec.close, details from https://github.com/logstash-plugins/logstash-input-file/issues/298:

In rare cases (multiple file inputs helps reproduce the issue) as the plugin attempts to stop it's identity codec, it ends up waking up the cleaner thread but the thread gets right back to (a 5 minute) sleep (when the cleaner.stop -> wakeup happens right before sleep on the other thread).

There's a more technical (isolated) reproducer which served as the inspiration for the spec: https://github.com/logstash-plugins/logstash-codec-multiline/issues/68

There's also a minor refactoring to explicitly declare the concurrent dependency + avoid the legacy ThreadSafe::Hash usage in favor of its Concurrent::Hash counterpart.

closes https://github.com/logstash-plugins/logstash-codec-multiline/issues/68

mback2k commented 3 years ago

Hi there, since I am the customer initially reporting this issue and thankful for a solution, would you be so kind and tell me to which version I have to update to get this fix? Thanks in advance!

kares commented 3 years ago

Hey Marc, sorry to cause confusion. I forgot to include the version + changelog entry in the PR but it's linked back from the following commit. Just do a bin/logstash-plugin update logstash-codec-multiline (should than update the plugin to >= 3.0.11)