Open fungiboletus opened 5 years ago
This is not a problem nor a leak. EventEmitter just had some strict limits on how many listeners it thinks one might need, but the way kafka-node uses the emitter this is a perfectly valid case.
The only way to avoid this false warning is to stop using event emitters for the queue and use an array of pending requests.
It looks like it creates an event listener per .send
when the broker is not connected. So the developer needs to set the max listeners higher than the number of .send
he can do before the timeout will trigger. So maybe not a leak, but it could be a lot of listeners.
Environment
10.14.0
4.1.0
For specific cases also provide
Sample
Run the following code without kafka running.
Wait a bit and you should see this error :