Skip to content

Child_process.exec returns empty stdout when many child processes are created #4709

Answered by bunglegrind
bunglegrind asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, after having performed another bazillion of tests, I'm going to write the "accepted" aswer.

When exec (or execFile) is invoked with a timeout, three different main cases may occur (there are some variations, though):

  1. Process is exited and the socket is closed before timeout expires, that is, the process close event is emitted (happy path)
  2. Process is still running when the timeout expires
  3. Process is exited but the socket is still open when the timeout expires, that is, process exit event is emitted, but not the process close event.

The problem here is that , from the point of view of the callback, there's no difference in those three cases, which is actually a bug imho.
you must chec…

Replies: 0 comments 16 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@bunglegrind
Comment options

@bnoordhuis
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@bnoordhuis
Comment options

@bunglegrind
Comment options

@bnoordhuis
Comment options

@bunglegrind
Comment options

@bnoordhuis
Comment options

Comment options

You must be logged in to vote
2 replies
@bnoordhuis
Comment options

@bunglegrind
Comment options

Answer selected by bunglegrind
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants