| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Review requested:
|
Sorry, something went wrong.
Signed-off-by: armanmikoyan <arman.mikoyan1@gmail.com>
There was a problem hiding this comment.
This seems appropriate to me. Even if a fix, this is a notable change in behavior. I believe notable-change is warranted at least. I'm not sure about semver. I don't want to tag all of the TSC, but I'll see if http/net folks have any input as the dgram subsystem is relatively close to those.
Sorry, something went wrong.
|
cc @nodejs/net @nodejs/http |
Sorry, something went wrong.
There was a problem hiding this comment.
lgtm
Sorry, something went wrong.
|
No, I think this is just a bug fix |
Sorry, something went wrong.
Sorry, something went wrong.
|
@mcollina I can't access the CI logs. Could someone let me know if the failures are related to my changes or just flaky? Happy to fix them if needed, or a re-run would be appreciated if they're unrelated. |
Sorry, something went wrong.
|
CI failure looks unrelated to me; its a sqlite-backup flake and some rebase infra issue. |
Sorry, something went wrong.
Sorry, something went wrong.
Signed-off-by: armanmikoyan <arman.mikoyan1@gmail.com> PR-URL: #62602 Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: armanmikoyan <arman.mikoyan1@gmail.com> PR-URL: #62602 Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
| Back | FazBrowse Home | New Git URL |
dgram: don't swallow bind errors when callback is provided
When Socket.prototype.bind() is called with a callback, the internal
cleanup listener is registered on 'error', which counts as an error
handler and silently swallows bind errors (e.g. EADDRINUSE) when no
user error handler is attached.
This switches to EventEmitter.errorMonitor for the cleanup listener,
matching the pattern already used in the enqueue() function
(lib/dgram.js:571). This ensures bind errors properly propagate as
unhandled errors while still performing listener cleanup.
Setup — a socket already bound to port 5000
No callback, no listening event — error surfaces (correct)
Using listening event — error surfaces (correct)
Using callback — error silently swallowed (bug)
All three examples do the same thing — bind to a port already in use.
The first two properly throw, but the third silently swallows the error
just because a callback was passed to bind().
After this fix, all three cases properly surface the error.