clickhouse icon indicating copy to clipboard operation
clickhouse copied to clipboard

EventEmitter: memory leak detected. Propose change-out deprecated request-library

Open 0xgeert opened this issue 3 years ago • 1 comments
trafficstars

I'm getting a lot of 'EventEmitter: memory leak detected'-messages, which turn out to be real: process crashes with an OOM after a day or so.

This is due to the request-lib not behaving nicely. https://github.com/request/request/issues/3139. This won't get fixed since request-library is deprecated.

Would you consider changing this out for something more robust, like axios, superagent, fetch?

0xgeert avatar Feb 17 '22 11:02 0xgeert

Doesn't solve the underlying issue (OOM still happens), but get rid of the warnings

// Prevent eventEmitter: memory leak detected to be shown. This happens (probably) inside request.js which is used by Clickhouse
// https://github.com/request/request/issues/3139
const EventEmitter = require('events');
EventEmitter.prototype.setMaxListeners(Infinity)

0xgeert avatar Mar 01 '22 18:03 0xgeert