dwbutler / logstash-logger

Ruby logger that writes logstash events
MIT License
456 stars 118 forks source link

Memoize buffer state #98

Closed dwbutler closed 8 years ago

dwbutler commented 8 years ago

When the buffer state is reset after dropping messages, the mutexes are also reinitialized with new instances. This causes an issue with buffer_flush when it tries to unlock the new mutex that it never locked, raising Attempt to unlock a mutex which is not locked (ThreadError).

This fixes the issue by memoizing the buffer mutexes and reusing them even when the buffer state is reset.

Fixes https://github.com/dwbutler/logstash-logger/issues/97