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

EventEmitter memory leak detected #13

Closed
herenickname opened this issue Oct 11, 2022 · 2 comments
Closed

EventEmitter memory leak detected #13

herenickname opened this issue Oct 11, 2022 · 2 comments

Comments

@herenickname
Copy link

herenickname commented Oct 11, 2022

I use a lot of runOnTransactionCommit hooks, so I caught this warning at runtime:

(node:25728) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 commit listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
    at _addListener (node:events:587:17)
    at EventEmitter.addListener (node:events:605:10)
    at EventEmitter.added (/root/v3/node_modules/emitter-listener/listener.js:93:27)
    at EventEmitter.once (node:events:649:8)
    at runOnTransactionCommit (/root/v3/node_modules/typeorm-transactional/dist/hooks/index.js:103:48)

It would be nice if you open events' method setMaxListeners publicly available to manage.

Thanks for this fork and your work.

@Aliheym
Copy link
Owner

Aliheym commented Oct 15, 2022

Hi, thanks for your issue.

I added options maxHookHandlers to handle this issue in new version.

  initializeTransactionalContext({ maxHookHandlers: 0 });

@Aliheym Aliheym closed this as completed Nov 14, 2022
@herenickname
Copy link
Author

Hi, thanks for your issue.

I added options maxHookHandlers to handle this issue in new version.

  initializeTransactionalContext({ maxHookHandlers: 0 });

Seems its still not implemented :(

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

No branches or pull requests

2 participants