-
-
Notifications
You must be signed in to change notification settings - Fork 341
fix(race-conditon): fix data race condition when accessing stderr on pipe
#209
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
Conversation
|
question: we currently do not run |
|
If we can have race conditions, we should definitely run CI tests with the race detector on! |
Added the |
bitfield
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good so far!
Signed-off-by: Mahad Zaryab <[email protected]>
|
@mahadzaryab1 I'm happy if you're happy—do you want to go ahead and do a final quality pass, checking documentation comments, alphabetical order, |
Signed-off-by: Mahad Zaryab <[email protected]>
@bitfield Done! Let me know if there's anything I missed. |
Signed-off-by: Mahad Zaryab <[email protected]>
bitfield
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super nice, @mahadzaryab1! Thanks a lot. I'll wait till you're done on #208, and then we can roll all these changes up into a new release.
There was a race condition that existed in
Pipe.Exec, which spins up a goroutine that accessPipe.stderrwithout a lock. This PR fixes that by protectingPipe.stderrwithPipe.mu. This PR fixes #193.Testing
Created a simple unit test as follows:
Running
go test -racebefore the changes in this PR outputted the same warning seen in the issue. Running it again with the changes in the PR cause the tests to pass.