-
Notifications
You must be signed in to change notification settings - Fork 110
Fix data races in TestLDBStoreCollectGarbage #1123
Conversation
I think we could use just a read lock, couldn't we? |
@janos I'm a little bit confused about the status of this PR, could you help me out? The test does not fix Shall we just close this with a no fix? [correction: fixes the data race but causes the test to fail for other reasons.] |
As discussed, on stand-up I'm trying to figure what to do with this. Problem:
Context:
1st (ugly,cheap) idea: skip the 2 failing test cases when
2nd idea: just drop the new locks and the 2 debug log lines
3rd idea: debug |
As the context parameter is not used and fixing it is not trivial, let's rather just drop that. Why is it not trivial? The usual select with <-ctx.Done() would not work, as ldb.gc.runC is always expected to have 1 element when the GC is not running. Also: #1151
Test fails unreliably when run with `-race` flag. As waitGC() does not work as expected, it might just continue (not block) if GC is not running already. We might end up with or without a chunk, depending on goroutine scheduling. As localstore rewrite is at the finish line and this blocks #741 => Skip.
@frncmx I agree. |
opened upstream ethereum/go-ethereum#18512 |
This PR addresses race condition described in #1118 and a similar one in gc tests.
This change solves data races, but it does not solve failing tests whenCurrently, the flaky test is disabled.go test
tool is called with -race. Tests are failing with not all expected chunks deleted by the garbage collection. If tests are run without the -race flag, they are passing as usual.We agreed on the standup not to dedicate more time to this failing tests, as regular tests are passing and we are working on a different gc implementation.