Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PG DataSource Error handler throwing memory leak warning #746

Open
vinod-hansda opened this issue Feb 18, 2025 · 0 comments
Open

PG DataSource Error handler throwing memory leak warning #746

vinod-hansda opened this issue Feb 18, 2025 · 0 comments
Labels

Comments

@vinod-hansda
Copy link
Contributor

Steps to reproduce

  • Add onError handler in DataSource for Loopback Connector Postgresql.
  • Use DataSource on frequent manner.
  • It should throw warnings like
    (node:80014) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [Client]. Use emitter.setMaxListeners() to increase limit

(More details to reproduce the issue are provided in the README.md file in the sandbox repository)

Current Behavior

It doesn't remove the attached error event listeners while releasing the connection back to pool.

Expected Behavior

It should remove attached event listener before releasing connection back to pool.

Link to reproduction sandbox

https://github.com/vinod-hansda/loopback-pg-warning

Additional information

node -e 'console.log(process.platform, process.arch, process.versions.node)' :-
darwin arm64 18.20.6

npm ls --prod --depth 0 | grep loopback :-
npm warn config production Use --omit=dev instead.
[email protected] /Users/vinodhansda/Documents/GitHub/loopback-pg-warning
├── @loopback/[email protected]
├── @loopback/[email protected]
├── @loopback/[email protected]
├── @loopback/[email protected]
├── @loopback/[email protected]
├── @loopback/[email protected]
├── [email protected]

Related Issues

See Reporting Issues for more tips on writing good issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant