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

fix: EventEmitter memory leak warnings when you have a significant number of child bridges. #2087

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

hjdhjd
Copy link
Contributor

@hjdhjd hjdhjd commented Jul 4, 2024

♻️ Current situation

If you use something like Home Manager on iOS and you have a significant number of child bridges, several IPC connections will be opened and they’ll easily exceed the default event limit, triggering a Node warning like:


(node:6868) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 disconnect listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
(node:6868) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 childBridgeStatusUpdate listeners added to [HomebridgeIpcService]. Use emitter.setMaxListeners() to increase limit
(node:6868) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 end listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
(node:6868) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 childBridgeMetadataResponse listeners added to [HomebridgeIpcService]. Use emitter.setMaxListeners() to increase limit
(node:6868) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 childBridgeMetadataResponse listeners added to [HomebridgeIpcService]. Use emitter.setMaxListeners() to increase limit

💡 Proposed solution

This PR addresses those by increasing and decreasing the limits dynamically.

⚙️ Release Notes

fix: EventEmitter memory leak warnings when using multiple child bridges utilize the IPC connection.

Reviewer Nudging

Where should the reviewer start? what is a good entry point?

@github-actions github-actions bot added fix latest Related to Latest Branch and removed fix labels Jul 4, 2024
@hjdhjd hjdhjd enabled auto-merge July 4, 2024 20:49
@hjdhjd hjdhjd requested a review from bwp91 July 4, 2024 20:49
@donavanbecker donavanbecker merged commit 00705fb into latest Jul 4, 2024
17 of 18 checks passed
@donavanbecker donavanbecker deleted the hjd-eventemitter-warnings branch July 4, 2024 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
latest Related to Latest Branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants