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

Test the stdout/stderr redirection #4

Open
xaprb opened this issue Sep 16, 2013 · 2 comments
Open

Test the stdout/stderr redirection #4

xaprb opened this issue Sep 16, 2013 · 2 comments

Comments

@xaprb
Copy link
Contributor

xaprb commented Sep 16, 2013

It would be great to have automated tests that verify that our piped STDERR and STDOUT are working correctly.

@parsley42
Copy link

+1 that. I had trouble daemonizing my gopherbot program, and with some help tracked it down to CaptureOutput. The symptom was an http POST hanging until it finally got killed by a SIGPIPE. I think it ended up having multiple threads reading from the same fd.

I was using CaptureOutput to feed stdout/sderr into the log file, but when I disabled that things started working again. If I get more time & motivation, I'll look more, but for now I'm just going to fix the library that's logging to stderr so I don't have to worry about capturing it. Otherwise godaemon is great - I was very happy with the ease of opening the log file in StageParent for later use in the daemon.

@ArcticSnowman
Copy link

@parsley42 - Interesting I find the opposite true... When CaptureOutput is false, calls to net/http Client.Do() hang. With CaptureOutput (true) but nothing reading from the captured output, the app just silently dies. With CaptureOutput(true) and a io.Copy sending it to a file, then it all works fine.

Raised this here golang/go#22165

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants