Skip to content

dgram: remove listeners on bind error - #30210

Closed
addaleax wants to merge 3 commits into
nodejs:masterfrom
addaleax:dgram-bind-error
Closed

dgram: remove listeners on bind error#30210
addaleax wants to merge 3 commits into
nodejs:masterfrom
addaleax:dgram-bind-error

Conversation

@addaleax

Copy link
Copy Markdown
Member
dgram: reset bind state before emitting error

This was previously done inconsistently, sometimes before, sometimes
after emitting the event.

dgram: remove listeners on bind error

This avoids piling up 'listening' event listeners if
.bind() fails repeatedly.

Fixes: #30209

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

This was previously done inconsistently, sometimes before, sometimes
after emitting the event.
This avoids piling up `'listening'` event listeners if
`.bind()` fails repeatedly.
Fixes: nodejs#30209
@nodejs-github-botnodejs-github-bot added the dgram Issues and PRs related to the dgram subsystem / UDP. label Nov 1, 2019
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Comment threadtest/parallel/test-dgram-bind-error-repeat.js Outdated
@addaleaxaddaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Nov 5, 2019
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@addaleax

Copy link
Copy Markdown
MemberAuthor

Landed in 99e874e115792d

@addaleaxaddaleax closed this Nov 6, 2019
addaleax added a commit that referenced this pull request Nov 6, 2019
This was previously done inconsistently, sometimes before, sometimes
after emitting the event.
PR-URL: #30210Fixes: #30209
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax added a commit that referenced this pull request Nov 6, 2019
This avoids piling up `'listening'` event listeners if
`.bind()` fails repeatedly.
Fixes: #30209
PR-URL: #30210
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@addaleax
addaleax deleted the dgram-bind-error branch November 6, 2019 23:55
@richardlaurichardlau mentioned this pull request Nov 7, 2019
4 tasks
MylesBorins pushed a commit that referenced this pull request Nov 17, 2019
This was previously done inconsistently, sometimes before, sometimes
after emitting the event.
PR-URL: #30210Fixes: #30209
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 17, 2019
This avoids piling up `'listening'` event listeners if
`.bind()` fails repeatedly.
Fixes: #30209
PR-URL: #30210
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BridgeARBridgeAR mentioned this pull request Nov 19, 2019
targos pushed a commit that referenced this pull request Dec 1, 2019
This was previously done inconsistently, sometimes before, sometimes
after emitting the event.
PR-URL: #30210Fixes: #30209
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Dec 1, 2019
This avoids piling up `'listening'` event listeners if
`.bind()` fails repeatedly.
Fixes: #30209
PR-URL: #30210
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BethGriggsBethGriggs mentioned this pull request Dec 9, 2019
MylesBorins pushed a commit that referenced this pull request Dec 17, 2019
This was previously done inconsistently, sometimes before, sometimes
after emitting the event.
PR-URL: #30210Fixes: #30209
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 17, 2019
This avoids piling up `'listening'` event listeners if
`.bind()` fails repeatedly.
Fixes: #30209
PR-URL: #30210
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BethGriggsBethGriggs mentioned this pull request Dec 23, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.dgramIssues and PRs related to the dgram subsystem / UDP.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EventEmitter memory leak with socket bind

7 participants

@addaleax@nodejs-github-bot@jasnell@lpinca@cjihrig@MylesBorins@BethGriggs