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

timeout option is not considered if streams are attached #157

Closed
ptusch opened this issue Nov 13, 2018 · 2 comments · Fixed by #199
Closed

timeout option is not considered if streams are attached #157

ptusch opened this issue Nov 13, 2018 · 2 comments · Fixed by #199
Labels
bug 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt help wanted

Comments

@ptusch
Copy link

ptusch commented Nov 13, 2018

Issuehunt badges

Hello there,

I was fiddling with the timeout option. It seems like it doesn't quite work as I'd expect (any maybe you as well!)

The setup

I have a bash script that sleeps for 6 seconds (sample.sh) and a nodejs file that is supposed to timeout after 200ms.

What's happening

The nodejs file rejects as expected but not after 200ms but after 6seconds. This is weird.
I investigated a bit and the internal timeout to kill the process is reached. The process is killed as well.

The issue seems to be this line; It looks like we are waiting for the stream of the killed process. It seems unusual since it will never talk again.
Removing the selected line (and the one after it) makes the process timeout nicely. The cleanup doesn't seem to be correct.

I've tried to work around by passing the options stdout and stderr and set each to null but that didn't really help.

Attached you'll find the sample project. Please let me know if something is missing. I might try to find a solution this evening.. ;)
execa_timeout_broken.tar.gz

gmartigny earned $30.00 by resolving this issue!

@IssueHuntBot
Copy link

@IssueHunt has funded $30.00 to this issue.


@IssueHuntBot
Copy link

@sindresorhus has rewarded $27.00 to @GMartigny. See it on IssueHunt

  • 💰 Total deposit: $30.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $3.00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants