MaxListenersExceededWarning: prisma 2.20.x and above
See original GitHub issueSummary
When upgrading @prisma/client
and prisma
from 2.19.0 to 2.20.x or newer, including 2.21.x, six in total “MaxListenersExceededWarning” messages are being logged:
(node:4511) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:4511) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGTERM listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:4511) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:4511) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGUSR2 listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:4511) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 beforeExit listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:4511) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGUSR1 listeners added to [process]. Use emitter.setMaxListeners() to increase limit
After the initial logs they don’t reappear until re-starting our GraphQL server. Prior to and with versions 2.19.0 this did not happen.
Background
We run our GraphQL Server as a serverless function on Lambda and create it with the apollo-server-lambda
. We are seeing these logs currently in our local development environment where we run the Lambda locally via the serverless-offline
plugin as we utilize the serverless framework for our deployment.
Dependency Versions
-
@prisma/client: 2.20.0 - 2.21.1
-
nexus-plugin-prisma: 0.34.1
-
prisma (dev): 2.20.0 - 2.21.1
-
serverless-offline: 6.6.0
-
apollo-server-lambda: ^2.19.0
Problem is seen using Node versions 12.19.1
and as of submitting latest 12 release 12.22.1
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top GitHub Comments
I can confirm the max listener warnings are gone. Thank you so much
@Jolg42 Just fixed it in deployments. It was
context.callbackWaitsForEmptyEventLoop = false;
. For some reason the latency is still there in offline. I sent @ryands17 a replication repo, I’ll post a new issue if we discover something on the prisma side. Thanks!