Saturday, 13 May 2017

Does the Node.js debugger send SIGINT/SIGTERM when exiting with Ctrl-C?

While running tests, I'm running into a situation where a server I've started isn't closed when exiting the Node.js debugger, and it seems like this is causing the debugger to not stop listening on port 5858.

debug> 
(To exit, press ^C again or type .exit)
debug>
$

But then...

$ node debug test.js
< Error: listen EADDRINUSE :::5858
<     at Object.exports._errnoException (util.js:1022:11)
<     at exports._exceptionWithHostPort (util.js:1045:20)
<     at Agent.Server._listen2 (net.js:1259:14)
<     at listen (net.js:1295:10)
<     at net.js:1405:9
<     at _combinedTickCallback (internal/process/next_tick.js:77:11)
<     at process._tickCallback (internal/process/next_tick.js:98:9)
connecting to 127.0.0.1:5858 ... ok

When you have Node.js debugger running, and you hit Ctrl-C twice, what does it to do the process you were debugging? Does it send SIGTERM or SIGINT or SIGKILL or something else?

And why doesn't the debugger detach sometimes? Resulting in port 5858 still being in use.



via Ian Storm Taylor

No comments:

Post a Comment