Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
fix a race condition in PipeListener #21
Conversation
|
Testing done: there was a test in juju (under worker/metrics/sender) that would occasionally hang (approx 1/10 times)... with this fix, no more hang in 300 trials. (also go test -race used to find a race condition and now does not) |
natefinch
merged commit c1b8fa8
into
v2
Jun 21, 2016
1 check passed
continuous-integration/appveyor/pr
AppVeyor build succeeded
Details
This was referenced Jun 21, 2016
added a commit
to juju/juju
that referenced
this pull request
Jun 21, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
natefinch commentedJun 21, 2016
•
Edited 1 time
-
natefinch
Jun 21, 2016
There was an obvious race between PipeListener's Accept and Close modifying l.closed, found with go test -race, and a less obvious race that if someone calls Close before we call connectnamedpipe, the connect would hang forever. Now we have a lock over the whole of Accept and Close (except while doing WaitSingleObject, which will corrently return an error when we Close), so Close can't screw up connect named pipe.