Skip to content

Conversation

@vladopajic
Copy link
Member

Description

peerScoreInspector is called periodically in separate goroutine started by waku-org/go-libp2p-pubsub. this goroutine can happen to execute simultaneously with goroutine running test TestUpAndDown thus causing race condition.

this issue will probably never appear in normal circumstances as waku node will not be started and stopped repeatedly. however it is nice test case to have as it can identify different issues.

Changes

  • added mutex that will guard simultaneous access to w.host in peerScoreInspector and SetHost.
  • changed order of RUnlock() to happen after RLock() in Topics() for the sake of consistency

How to test

it's hard to reproduce this issue as it is data race.

Issue

closes #984

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: intermittent data race noticed in CI

1 participant