Skip to content
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

TypeError: Forked processes must have an IPC channel #8167

Closed
sandro-pasquali opened this issue Aug 18, 2016 · 5 comments
Closed

TypeError: Forked processes must have an IPC channel #8167

sandro-pasquali opened this issue Aug 18, 2016 · 5 comments
Labels
child_process Issues and PRs related to the child_process subsystem. doc Issues and PRs related to the documentations.

Comments

@sandro-pasquali
Copy link

v.6.4.0
Darwin MacBook-Pro.local 14.5.0 Darwin Kernel Version 14.5.0: Tue Sep 1 21:23:09 PDT 2015; root:xnu-2782.50.1~1/RELEASE_X86_64 x86_64

I think this is my error, but maybe something to document?

After upgrading from 6.3 -> 6.4 fork will not accept the following:

fork('...', [], {
    stdio: [0,1,2] 
});

Requiring:

fork('...', [], {
    stdio: [0,1,2,'ipc']
});

Not setting stdio also works...

@addaleax addaleax added the child_process Issues and PRs related to the child_process subsystem. label Aug 18, 2016
@cjihrig
Copy link
Contributor

cjihrig commented Aug 18, 2016

fork() didn't support a stdio option before. Now it does.

@sandro-pasquali
Copy link
Author

Thanks. Would it be useful to update these docs to emphasize that? (right now the docs seem to imply that [0,1,2] is a valid setting, and that ipc is optional. Or maybe that's just me :)

https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio

@cjihrig
Copy link
Contributor

cjihrig commented Aug 18, 2016

We don't currently have a good way to mark when things like that change the way that we do when a new method is added. However, I agree that it would be good to update the stdio section of https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_child_process_fork_modulepath_args_options to say that an 'ipc' entry is required. Note, the docs you linked to probably aren't the ideal place to say that, since this is fork() specific.

@cjihrig
Copy link
Contributor

cjihrig commented Aug 18, 2016

You might want to use https://nodejs.org/api/cluster.html#cluster_cluster_settings as a reference if you plan to make a PR.

@Fishrock123 Fishrock123 added the doc Issues and PRs related to the documentations. label Aug 19, 2016
jasnell added a commit to jasnell/node that referenced this issue Aug 27, 2016
Fishrock123 pushed a commit to Fishrock123/node that referenced this issue Sep 8, 2016
Fixes: nodejs#8167
PR-URL: nodejs#8290
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Fishrock123 pushed a commit that referenced this issue Sep 9, 2016
Fixes: #8167
PR-URL: #8290
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
@sam-github sam-github added doc Issues and PRs related to the documentations. and removed doc Issues and PRs related to the documentations. labels Dec 1, 2016
@bchenSyd
Copy link

why the ipc fd is only required in fork? not in spawn?
what's the fundamental difference between fork and spawn? isn't fork a specific type of spawn where process name is slated to node?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
child_process Issues and PRs related to the child_process subsystem. doc Issues and PRs related to the documentations.
Projects
None yet
Development

No branches or pull requests

6 participants