Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Cannot work with stdin in a sub-subprocess with require('child_process').fork()  #3240

Closed
@indexzero

Description

I'm pretty sure this is a bug. @substack and I spent some time tracking this down when his application wouldn't deploy to nodejitsu:

Reproduce it

  1. Clone this application: http://github.com/substack/pix
  2. Add this script to it: https://gist.github.com/2640933

In (2) I added a layer of indirection which spawns server.js, once with .fork() and once with .spawn().

Here's a quick rundown of the process tree(s):

  1. Just running node server.js
  server.js
   `-- worker.js
   `-- worker.js
  1. Running node spawn.js
  spawn.js
    `-- server.js
          `-- worker.js
          `-- worker.js

So just that one level of indirection with .fork() breaks all piping of process.stdin.

@piscisaureus @isaacs @bnoordhuis You guys have any thoughts here? I'm stumped why this is happening, but I know it is.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions