loopback-connector-postgresql icon indicating copy to clipboard operation
loopback-connector-postgresql copied to clipboard

PG DataSource Error handler throwing memory leak warning

Open vinod-hansda opened this issue 10 months ago • 0 comments

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

vinod-hansda avatar Feb 18 '25 06:02 vinod-hansda