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

Improve error reporting when invoking weave script #2335

Merged
merged 4 commits into from
Mar 21, 2017

Conversation

2opremio
Copy link
Contributor

Fixes #2191

@2opremio 2opremio requested a review from ekimekim March 15, 2017 10:46
Copy link
Contributor

@ekimekim ekimekim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds (I think? Unsure without looking under the hood whether previously stderr was a pipe or not) a deadlock condition where stderr fills up, but we aren't reading from it because we're waiting for stdout to EOF, but stdout isn't EOFing because the program is blocking trying to write to stderr.
It's non-trivial to fix and very unlikely to ever be a real issue, so I'm happy to ignore it.

LGTM

* The Stderr pipe should be read before waiting
* The Stderr pipe should not be used with Run/Output. See https://golang.org/pkg/os/exec/#Cmd.StderrPipe:

  Wait will close the pipe after seeing the command exit, so most callers need
  not close the pipe themselves; however, an implication is that it is incorrect
  to call Wait before all reads from the pipe have completed. For the same
  reason, it is incorrect to use Run when using StderrPipe.
@2opremio
Copy link
Contributor Author

@ekimekim I fixed a couple of problems, please take another look

@ekimekim
Copy link
Contributor

modulo tests passing, ofc

@2opremio 2opremio merged commit 4aeeeb8 into master Mar 21, 2017
@2opremio 2opremio deleted the 2191-improve-weave-net-errors branch March 21, 2017 16:21
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

Successfully merging this pull request may close these issues.

2 participants