-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
Race condition in capnp #325
Comments
@hspaay Can you try upgrading to alpha 7? I think this was fixed. |
The race test sometimes errors out with a nil exception. In one captured example this shows up in transport.go:358 (alpha-5)
cr.Reader is nil At the same time transport.go:130 (function NewMessage) tries to Encode the message: |
@lthibault speaking of race conditions, lol. |
Both race and state tests fail on alpha-7 |
Interesting! Thanks for the update. Let's see if #318 fixes it. Should land in a few days time. |
Follow-up question: which test triggers the race condition? Could this issue be a duplicate of #301? |
Yeah, I think this is probably the same as #301, but great that we apparently have the ability to semi-reproduce it now. |
Yes! Many thanks for this @hspaay !! |
Glad to be of help. Just let me know when you have a potential fix. It should be easy to verify now. |
@hspaay Can you try this again with the latest tagged version? |
@lthibault unfortunately the race is still there using: capnproto.org/go/capnp/v3 v3.0.0-alpha.8
|
But wait, there is more. go test -p 1 ./pkg/race just fails on leakyread, without -race. It just fails. Maybe something I'm doing wrong because this is clearly broken.
|
Update: these problems might be caused by the way the tests are run. Each test uses the same socket path to connect. When one test is finished, the connection is dropped then the next test runs. However, if the cleanup in the background takes some time, the next test is already starting. The first thing the test does is to remove the socket. Conclusions: False alarm and cleanup is tricky. |
Thanks for following up on this ! |
Problem: Running go test -race on my modules sometimes fails with a race condition in go-capnproto2's transport.
To reproduce:
The offending code was extracted and put into a simpler repo here: github.com/hiveot/racetest.
This repo has 2 tests, 'race' and 'state'. They each show different problems, although it is possible that 'race''s problem is the result of simplification.
Setup the tests:
Race Package
To reproduce, run this a few times. It usually shows up within 3 attempts:
Output of 'race':
State Package
The 'state' package intermittently shows a race. Usually it shows up within 10 attempts.
Output of 'state':
The text was updated successfully, but these errors were encountered: