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

Data race in swarm/network fetcher_test.go #1109

Closed
frncmx opened this issue Jan 14, 2019 · 0 comments · Fixed by ethereum/go-ethereum#18469
Closed

Data race in swarm/network fetcher_test.go #1109

frncmx opened this issue Jan 14, 2019 · 0 comments · Fixed by ethereum/go-ethereum#18469

Comments

@frncmx
Copy link
Contributor

frncmx commented Jan 14, 2019

How to reproduce?

go test -race -count 1 -run TestFetcherRetryOnTimeout github.com/ethereum/go-ethereum/swarm/network

There are more data races then in the first report. Run also:
go test -race -count 1 -v -run '^(TestFetcherSingleRequest|TestFetcherCancelStopsFetcher|TestFetcherCancelStopsRequest|TestFetcherOfferUsesSource|TestFetcherOfferAfterRequestUsesSourceFromContext|TestFetcherRetryOnTimeout|TestFetcherFactory|TestFetcherRequestQuitRetriesRequest|TestRequestSkipPeer|TestRequestSkipPeerExpired|TestRequestSkipPeerPermanent|TestFetcherMaxHopCount|TestSetTestHookFetcherRun)$' github.com/ethereum/go-ethereum/swarm/network

Stacktrace

WARNING: DATA RACE
Read at 0x0000015741b0 by goroutine 17:
  github.com/ethereum/go-ethereum/swarm/network.(*Fetcher).run()
      /home/frncmx/code/src/github.com/ethereum/go-ethereum/swarm/network/fetcher.go:246 +0x42a

Previous write at 0x0000015741b0 by goroutine 16:
  github.com/ethereum/go-ethereum/swarm/network.TestFetcherRetryOnTimeout.func1()
      /home/frncmx/code/src/github.com/ethereum/go-ethereum/swarm/network/fetcher_test.go:292 +0x3a
  github.com/ethereum/go-ethereum/swarm/network.TestFetcherRetryOnTimeout()
      /home/frncmx/code/src/github.com/ethereum/go-ethereum/swarm/network/fetcher_test.go:332 +0x598
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:827 +0x162

Goroutine 17 (running) created at:
  github.com/ethereum/go-ethereum/swarm/network.TestFetcherRetryOnTimeout()
      /home/frncmx/code/src/github.com/ethereum/go-ethereum/swarm/network/fetcher_test.go:300 +0x497
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:827 +0x162

Goroutine 16 (finished) created at:
  testing.(*T).Run()
      /usr/lib/go/src/testing/testing.go:878 +0x659
  testing.runTests.func1()
      /usr/lib/go/src/testing/testing.go:1119 +0xa8
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:827 +0x162
  testing.runTests()
      /usr/lib/go/src/testing/testing.go:1117 +0x4ee
  testing.(*M).Run()
      /usr/lib/go/src/testing/testing.go:1034 +0x2ee
  main.main()
      _testmain.go:106 +0x221
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants