Skip to content
This repository has been archived by the owner on Mar 10, 2023. It is now read-only.

Clearing Pool doesn't remove event listeners #11

Open
marek-ganko opened this issue Jan 20, 2021 · 0 comments
Open

Clearing Pool doesn't remove event listeners #11

marek-ganko opened this issue Jan 20, 2021 · 0 comments

Comments

@marek-ganko
Copy link

Event listeners are not removed when the connection is closed and pool.clear() is triggered.

I'm using typeorm SapDriver, and when the connection is opened and then closed over 10 times (in tests) than I'm getting this warning:

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 poolError listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit

Also it seems that PoolManager.eventEmitter() shouldn't be a static method, because in case of multi-tenants scenario, errors will be shown for every tenant connection.

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

No branches or pull requests

1 participant