Add missing -race flag to build-race make target#86
Add missing -race flag to build-race make target#86Vervious merged 6 commits intoalgorand:masterfrom
Conversation
It appears that we were compiling without golang race detector when we intended the opposite.
|
Thanks for catching this -- the It looks like this now catches some races in kmd.. |
tsachiherman
left a comment
There was a problem hiding this comment.
The change is good, unfortunately, it fails during the unit tests. You might need to fix these before submitting this fix. ( if you feel that it goes beyond the scope of this task, please open a separate tickets for each individual failure )
|
(working on the races) |
|
If this is helpful -- I started looking at the failures that show up with this patch, and got as far as tracking at least one of the failures down to kmd's exit timeout, and some strange interaction with the race detection binaries. Specifically, I get a quick reproducible failure on my laptop when I change |
I accidnetally crashed my machine by failing too many e2e tests, and leaving 20+ algods consuming too much of my cpu.
using value receivers constitutes a read, so we'd have to synchronize method calls. so instead I think using pointer receivers is fine - see line 226 (ws.shutdown = true) and line 262 (ws.writeStateFiles(addr)) where go -race complains
|
(this might not be the only race - I haven't rerun the tests - but it's at least one race) The other change is motivated by me accidentally crashing my machine running the e2e tests, since failures weren't cleaning up the dozens of algod processes that got spawned, which stole my cpu. (as a whole, still wip) |
|
Ok - this still doesn't fix the tests. (Also, thank you Nickolai for the reproducible tip! Very helpful so far). Still investigating. |
|
It appears that doing something like with I'm now looking at what happens when |
|
Interesting. One possibility is to change the scrypt default params (like |
|
It's possible though I'm wondering if we should muck around with kmd's (This is all assuming Scrypt is actually the issue for larger timeouts.) |
|
I say exclude -race from kmd entirely, at least when run on travis (except maybe on builds that run overnight). Mucking around with the kmd codebase to let tests use different scrypt parameters sounds like complexity we don't want inside kmd. We want kmd code to have as little complexity as possible; if kmd race tests require nontrivial messing with kmd internals then they're doing more harm than good. |
|
So locally, with timeout = 60 seconds, the same problem occurs. It looks like (in takes at least a minute locally for me when running |
|
Sure, let's exclude kmd from -race for now |
And put it into bin-race to avoid messing with too much of the testing flow. Apologies for complicating the makefile even further.
Fix stale state bug
we were compiling without golang race detector where we intended the opposite.