question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MaxListenersExceededWarning: prisma 2.20.x and above

See original GitHub issue

Summary

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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
shane-abcyacommented, Apr 15, 2021

This should be fixed in 2.21.2 let us know if it’s the case, if not, we can reopen this issue.

I can confirm the max listener warnings are gone. Thank you so much

3reactions
dborstelmanncommented, Nov 5, 2021

@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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to keep the version of your Prisma server in sync with the ...
To install a specific version x of the Prisma CLI, run: npm install -g prisma1@x. For example, if you wanted to install the...
Read more >
Prisma Client and Prisma schema preview features
When we release a new Prisma Client or Prisma schema feature, it often starts in preview so that you can test it and...
Read more >
Prisma Client API (Reference)
This section describes the PrismaClient constructor and its parameters. ... Where possible, Prisma Client hands over an upsert query to the database.
Read more >
Backend with TypeScript, PostgreSQL & Prisma: CI ...
In this article, you will set up GitHub Actions as the CI/CD server by defining a workflow that runs the tests and deploys...
Read more >
Prisma engines
Learn about Prisma internals and how it works "under the hood". Prisma tools are based on an engine-layer which manages the communication with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found