-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
fix: report timeout as error instead of writing message to stderr #68
Conversation
Codecov Report
@@ Coverage Diff @@
## master #68 +/- ##
==========================================
- Coverage 83.55% 83.48% -0.08%
==========================================
Files 1 1
Lines 225 224 -1
==========================================
- Hits 188 187 -1
Misses 21 21
Partials 16 16
Continue to review full report at Codecov.
|
@amyangfei PTAL too, as this was introduced in #66 |
1029d75
to
bfa1be1
Compare
bfa1be1
to
d52fc63
Compare
I may be wrong, but I'm pretty sure the |
fix slow select
Lines 336 to 342 in 6671f69
Write false to doneChan is enougth when timeout, no need to send error msg to errChan.
|
Rename |
I have observed panics on some specific commands:
That the
stderrChan
is closed before timeout message is written to it. However, if closing the channel in the upper level goroutine, it's possible thatstderrScanner
continues to read data after timeout reached, if the channel is closed in timeout case, it still panics.So use the
errChan
to report timeout and letstderrChan
purely be with thestderr
of command output, to avoid writing and closing the channel in two different goroutines.