Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Race in pstoreds #153

Closed
Kubuxu opened this issue May 26, 2020 · 1 comment
Closed

Race in pstoreds #153

Kubuxu opened this issue May 26, 2020 · 1 comment

Comments

@Kubuxu
Copy link
Member

Kubuxu commented May 26, 2020

WARNING: DATA RACE
Write at 0x00c000330c20 by goroutine 195:
  github.com/libp2p/go-libp2p-peerstore/pstoreds.(*addrsRecord).flush()
      /go/pkg/mod/github.com/libp2p/go-libp2p-peerstore@v0.2.4/pstoreds/addr_book.go:67 +0x3cb
  github.com/libp2p/go-libp2p-peerstore/pstoreds.(*dsAddrBook).storeSignedPeerRecord()
      /go/pkg/mod/github.com/libp2p/go-libp2p-peerstore@v0.2.4/pstoreds/addr_book.go:324 +0x24d
  github.com/libp2p/go-libp2p-peerstore/pstoreds.(*dsAddrBook).ConsumePeerRecord()
      /go/pkg/mod/github.com/libp2p/go-libp2p-peerstore@v0.2.4/pstoreds/addr_book.go:291 +0x2a5
  github.com/libp2p/go-libp2p-peerstore/pstoreds.(*pstoreds).ConsumePeerRecord()
      <autogenerated>:1 +0x63
  github.com/libp2p/go-libp2p/p2p/host/basic.(*BasicHost).background.func1()
      /go/pkg/mod/github.com/libp2p/go-libp2p@v0.9.2/p2p/host/basic/basic_host.go:418 +0x410
  github.com/libp2p/go-libp2p/p2p/host/basic.(*BasicHost).background()
      /go/pkg/mod/github.com/libp2p/go-libp2p@v0.9.2/p2p/host/basic/basic_host.go:437 +0x1b3

Previous read at 0x00c000330c20 by goroutine 184:
  github.com/libp2p/go-libp2p-peerstore/pstoreds.(*addrsRecord).clean()
      /go/pkg/mod/github.com/libp2p/go-libp2p-peerstore@v0.2.4/pstoreds/addr_book.go:90 +0x118
  github.com/libp2p/go-libp2p-peerstore/pstoreds.(*dsAddrBook).loadRecord()
      /go/pkg/mod/github.com/libp2p/go-libp2p-peerstore@v0.2.4/pstoreds/addr_book.go:218 +0x17a
  github.com/libp2p/go-libp2p-peerstore/pstoreds.(*dsAddrBook).GetPeerRecord()
      /go/pkg/mod/github.com/libp2p/go-libp2p-peerstore@v0.2.4/pstoreds/addr_book.go:332 +0x74
  github.com/libp2p/go-libp2p-peerstore/pstoreds.(*pstoreds).GetPeerRecord()
      <autogenerated>:1 +0x5b
  github.com/libp2p/go-libp2p/p2p/protocol/identify.(*IDService).getSnapshot()
      /go/pkg/mod/github.com/libp2p/go-libp2p@v0.9.2/p2p/protocol/identify/id.go:430 +0x296
  github.com/libp2p/go-libp2p/p2p/protocol/identify.newPeerHandler()
      /go/pkg/mod/github.com/libp2p/go-libp2p@v0.9.2/p2p/protocol/identify/peer_loop.go:51 +0x1072
  github.com/libp2p/go-libp2p/p2p/protocol/identify.(*IDService).loop()
      /go/pkg/mod/github.com/libp2p/go-libp2p@v0.9.2/p2p/protocol/identify/id.go:194 +0x1061

Goroutine 195 (running) created at:
  github.com/libp2p/go-libp2p/p2p/host/basic.(*BasicHost).Start()
      /go/pkg/mod/github.com/libp2p/go-libp2p@v0.9.2/p2p/host/basic/basic_host.go:289 +0x69
  github.com/libp2p/go-libp2p/config.(*Config).NewNode()
      /go/pkg/mod/github.com/libp2p/go-libp2p@v0.9.2/config/config.go:344 +0x760
  github.com/libp2p/go-libp2p.NewWithoutDefaults()
      /go/pkg/mod/github.com/libp2p/go-libp2p@v0.9.2/libp2p.go:71 +0x136
  github.com/libp2p/go-libp2p.New()
      /go/pkg/mod/github.com/libp2p/go-libp2p@v0.9.2/libp2p.go:57 +0xa09
  github.com/drand/drand/cmd/relay-gossip/lp2p.ConstructHost()
      /go/src/github.com/drand/drand/cmd/relay-gossip/lp2p/ctor.go:64 +0x894
  github.com/drand/drand/cmd/relay-gossip/client.newTestClient()
      /go/src/github.com/drand/drand/cmd/relay-gossip/client/relayclient_test.go:72 +0x341
  github.com/drand/drand/cmd/relay-gossip/client.TestClient()
      /go/src/github.com/drand/drand/cmd/relay-gossip/client/relayclient_test.go:44 +0x506
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:991 +0x1eb

Goroutine 184 (running) created at:
  github.com/libp2p/go-libp2p/p2p/protocol/identify.NewIDService()
      /go/pkg/mod/github.com/libp2p/go-libp2p@v0.9.2/p2p/protocol/identify/id.go:144 +0x503
  github.com/libp2p/go-libp2p/p2p/host/basic.NewHost()
      /go/pkg/mod/github.com/libp2p/go-libp2p@v0.9.2/p2p/host/basic/basic_host.go:203 +0x1087
  github.com/libp2p/go-libp2p/config.(*Config).NewNode()
      /go/pkg/mod/github.com/libp2p/go-libp2p@v0.9.2/config/config.go:188 +0x209
  github.com/libp2p/go-libp2p.NewWithoutDefaults()
      /go/pkg/mod/github.com/libp2p/go-libp2p@v0.9.2/libp2p.go:71 +0x136
  github.com/libp2p/go-libp2p.New()
      /go/pkg/mod/github.com/libp2p/go-libp2p@v0.9.2/libp2p.go:57 +0xa09
  github.com/drand/drand/cmd/relay-gossip/lp2p.ConstructHost()
      /go/src/github.com/drand/drand/cmd/relay-gossip/lp2p/ctor.go:64 +0x894
  github.com/drand/drand/cmd/relay-gossip/client.newTestClient()
      /go/src/github.com/drand/drand/cmd/relay-gossip/client/relayclient_test.go:72 +0x341
  github.com/drand/drand/cmd/relay-gossip/client.TestClient()
      /go/src/github.com/drand/drand/cmd/relay-gossip/client/relayclient_test.go:44 +0x506
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:991 +0x1eb
@Kubuxu
Copy link
Member Author

Kubuxu commented Jun 5, 2020

Resolved by #154

@Kubuxu Kubuxu closed this as completed Jun 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant