-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Listeners for SIGINT (and other) signals are not registered in EventEmitter #22892
Labels
Comments
This was referenced May 18, 2024
marvinhagemeister
added a commit
that referenced
this issue
May 20, 2024
Some npm libraries like `signal-exit` rely on the length of the listener array returned by `process.listeners("SIGNT")` to be correct to function. We weren't tracking `SIG*` events there, which broke those npm libraries. Fixes #22892
bartlomieju
pushed a commit
that referenced
this issue
May 21, 2024
Some npm libraries like `signal-exit` rely on the length of the listener array returned by `process.listeners("SIGNT")` to be correct to function. We weren't tracking `SIG*` events there, which broke those npm libraries. Fixes #22892
bartlomieju
pushed a commit
that referenced
this issue
May 21, 2024
Some npm libraries like `signal-exit` rely on the length of the listener array returned by `process.listeners("SIGNT")` to be correct to function. We weren't tracking `SIG*` events there, which broke those npm libraries. Fixes #22892
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version: Deno 1.41.2
Description
Deno correctly registers
SIGINT
and otherSIG*
signals withprocess.on('SIGINT')
vianode:process
imports, but the listeners are not appended toprocess.listeners('SIGINT')
return array. This differs from the original Node.js implementation behavior and causes issues with libraries such as[email protected]
Reproduction Steps
Explanation
Since Deno uses a custom implementation for handling OS Signals, a specific condition was added to the
process
polyfill to redirect allprocess.on()
calls forSIG*
signals to useDeno.addSignalListener()
. However, the method responsible for adding the listener to the array is located atsuper.on()
(in theEventEmitter
class), which is never called.Possible Fix
One possible fix would be to add the
super.on(event, listener);
call right after theDeno.addSignalListener()
line, but I am not sure whether this would cause unintended side-effects between Deno and the polyfill.Thanks for building Deno!
The text was updated successfully, but these errors were encountered: