Closed
Description
I recently deployed an update of this gem and immediately noticed the thread count per instance was constantly increasing over time.
After looking into the code, I found the cause.
When the buffer is initialized, it calls reset_buffer to set up the buffer state. In there, it launches a timer thread containing an infinite loop.
on buffer_receive
, the default behaviour when the buffer is full is to drop the messages. It does so by calling... reset_buffer, which ends up creating a new thread while the other still lives.
The result is a new thread that never exits for every full buffer.