You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do you want to request a feature or report a bug?
bug
What is the current behavior?
Using useDb for reuse connection to replicaset mongodb server in multi-tenant architecture, after call useDb for 100 different database names. The nodejs Warning occur:
(node:35699) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [MongoClient]. Use emitter.setMaxListeners() to increase limit
(node:35699) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 timeout listeners added to [MongoClient]. Use emitter.setMaxListeners() to increase limit
(node:35699) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [MongoClient]. Use emitter.setMaxListeners() to increase limit
(node:35699) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 parseError listeners added to [MongoClient]. Use emitter.setMaxListeners() to increase limit
If the current behavior is a bug, please provide the steps to reproduce.
const conn = mongoose.createConnection(uri, {
useUnifiedTopology: true,
})
for(let i = 0; i < 100; i++) {
const db = conn.useDb(`db_${i}`)
}
What is the expected behavior?
The warning was not shown
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Nodejs: 12.22.1
mongoose: 5.13.9
The text was updated successfully, but these errors were encountered:
So it reproduces on both 5.13.9 and latest, however, the error message prints once on latest whereas it prints 4 times on 5.13.9. How do you want to proceed @vkarpov15
Do you want to request a feature or report a bug?
bug
What is the current behavior?
Using
useDb
for reuse connection to replicaset mongodb server in multi-tenant architecture, after call useDb for 100 different database names. The nodejs Warning occur:If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
The warning was not shown
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Nodejs: 12.22.1
mongoose: 5.13.9
The text was updated successfully, but these errors were encountered: