-
Notifications
You must be signed in to change notification settings - Fork 30k
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 with socket bind #30209
Labels
confirmed-bug
Issues with confirmed bugs.
dgram
Issues and PRs related to the dgram subsystem / UDP.
Comments
addaleax
added
dgram
Issues and PRs related to the dgram subsystem / UDP.
confirmed-bug
Issues with confirmed bugs.
labels
Nov 1, 2019
addaleax
added a commit
to addaleax/node
that referenced
this issue
Nov 1, 2019
This avoids piling up `'listening'` event listeners if `.bind()` fails repeatedly. Fixes: nodejs#30209
3 tasks
addaleax
added a commit
that referenced
this issue
Nov 6, 2019
This avoids piling up `'listening'` event listeners if `.bind()` fails repeatedly. Fixes: #30209 PR-URL: #30210 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
MylesBorins
pushed a commit
that referenced
this issue
Nov 17, 2019
This was previously done inconsistently, sometimes before, sometimes after emitting the event. PR-URL: #30210 Fixes: #30209 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
MylesBorins
pushed a commit
that referenced
this issue
Nov 17, 2019
This avoids piling up `'listening'` event listeners if `.bind()` fails repeatedly. Fixes: #30209 PR-URL: #30210 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
targos
pushed a commit
that referenced
this issue
Dec 1, 2019
This was previously done inconsistently, sometimes before, sometimes after emitting the event. PR-URL: #30210 Fixes: #30209 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
targos
pushed a commit
that referenced
this issue
Dec 1, 2019
This avoids piling up `'listening'` event listeners if `.bind()` fails repeatedly. Fixes: #30209 PR-URL: #30210 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
MylesBorins
pushed a commit
that referenced
this issue
Dec 17, 2019
This was previously done inconsistently, sometimes before, sometimes after emitting the event. PR-URL: #30210 Fixes: #30209 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
MylesBorins
pushed a commit
that referenced
this issue
Dec 17, 2019
This avoids piling up `'listening'` event listeners if `.bind()` fails repeatedly. Fixes: #30209 PR-URL: #30210 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
confirmed-bug
Issues with confirmed bugs.
dgram
Issues and PRs related to the dgram subsystem / UDP.
When binding to a broadcast socket using-
And retrying the bind after a failure-
After a few failures I receive this message-
(node:68039) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 listening listeners added. Use emitter.setMaxListeners() to increase limit
For example, if something else has bound to the same broadcast port and has locked the port.
The issue is caused by-
node/lib/dgram.js
Line 194 in eac6143
arguments[arguments.length - 1]
is intended to be the callback. In the case of a failure, the callback doesn't execute and the callback remains in the event queue waiting to be executed. If there are 10 bind failures the callback will execute 10 times after being able to successfully bind in the 11th retry.A workaround-
Define the callback as a named function and remove the callback if an error is encountered.
The text was updated successfully, but these errors were encountered: