clickhouse
clickhouse copied to clipboard
EventEmitter: memory leak detected. Propose change-out deprecated request-library
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?
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)