-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Spawning Child Processes Causes "Error: uv_signal_start EINVAL" Exception for 0.10.20 or 0.11.8-pre in AMD64 Linux Environment. #6339
Comments
That very likely means you're trying to install a signal handler for SIGKILL or SIGSTOP. In old versions of node that was allowed in the sense that node didn't check the return value of sigaction(). Of course, it didn't work - you can't catch those signals. In newer versions you get an EINVAL error. Closing, working as expected. |
How can i debug my graceful shutdown code, it seems to be impossible no matter which IDE i use since none of them shuts down the debug sessions with something else other than SIGKILL SIGINT SIGTERM |
There is no solution, you can't catch SIGKILL. |
Its not about catching it, its about being able to debug the graceful shutdown code |
Then you should rephrase your question because I don't understand what you're getting at. |
Its now updated, hopefully its more clear now |
Can you add some sample code, which is at best self contained? |
@tomerb15 You can install event handlers for SIGINT and SIGTERM. If your IDE sends SIGKILL however, you're out of luck. |
@eljefedelrodeodeljefe here is the code from my app.js:
The challenge is to be able to debug |
Google brought me here years later, this is worth reading. https://nodejs.org/api/process.html#process_signal_events |
(1) A node application written under 0.8 an 0.9 was able to spawn child processes without problems.
(2) On 11 Oct 2013, node was upgraded to 0.10.20 and the application began to crash each time processes were spawned or each time process.on() was called.
(3) Further investigation pulled down the latest code for 0.11.8-pre and reproduced the issue.
(4) The following EXCEPTION output was encountered:
app.main[2013-10-12T01:36:35.928Z] app.js PID:[2939]
app.main[2013-10-12T01:36:35.929Z] Setup Process Management
node.js:612
throw errnoException(err, 'uv_signal_start');
^
Error: uv_signal_start EINVAL
at exports._errnoException (util.js:676:11)
at process.on.process.addListener (node.js:612:17)
at Object. (/srv/nemesis/app/app.js:60:9)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:349:32)
at Function.Module._load (module.js:305:12)
at Function.Module.runMain (module.js:490:10)
at startup (node.js:121:16)
at node.js:764:3
done.
NODE VERSION: v0.11.8-pre
(5) The following EXCEPTION output was encountered elsewhere in the app:
lib.worker[2013-10-12T01:04:28.143Z] worker.js is starting...
node.js:762
throw errnoException(process._errno, 'uv_signal_start');
^
Error: uv_signal_start EINVAL
at errnoException (node.js:540:13)
at process.on.process.addListener (node.js:762:17)
at Object. (/srv/nemesis/app/library/worker.js:78:9)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
The text was updated successfully, but these errors were encountered: