Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitswap without DHT integration tests occasionally hanging #815

Closed
whyrusleeping opened this issue Feb 25, 2015 · 6 comments
Closed

Bitswap without DHT integration tests occasionally hanging #815

whyrusleeping opened this issue Feb 25, 2015 · 6 comments
Labels
kind/bug A bug in existing code (including security flaws) topic/test failure Topic test failure

Comments

@whyrusleeping
Copy link
Member

Logs here:
https://gist.github.com/whyrusleeping/8f5693e8ceea552a8b9c

@whyrusleeping whyrusleeping added topic/test failure Topic test failure kind/bug A bug in existing code (including security flaws) labels Feb 25, 2015
@whyrusleeping
Copy link
Member Author

Appears to maybe be a duplicate of #805

@whyrusleeping
Copy link
Member Author

Found a data race:

whyrusleeping@idril ~/g/s/g/j/go-ipfs (master)> go test ./test/integration/ -v -run TestBitswapWithoutRouting -race
=== RUN TestBitswapWithoutRouting
==================
WARNING: DATA RACE
Write by goroutine 193:
  sync.raceWrite()
      /home/whyrusleeping/go/src/sync/race.go:41 +0x36
  sync.(*WaitGroup).Wait()
      /home/whyrusleeping/go/src/sync/waitgroup.go:125 +0x177
  github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-ctxgroup.(*contextGroup).closeLogic()
      /home/whyrusleeping/gopkg/src/github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-ctxgroup/ctxgroup.go:202 +0xd7
  github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-ctxgroup.*contextGroup.(github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-ctxgroup.closeLogic)·fm()
      /home/whyrusleeping/gopkg/src/github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-ctxgroup/ctxgroup.go:192 +0x34
  sync.(*Once).Do()
      /home/whyrusleeping/go/src/sync/once.go:44 +0xe6

Previous read by goroutine 115:
  sync.raceRead()
      /home/whyrusleeping/go/src/sync/race.go:37 +0x36
  sync.(*WaitGroup).Add()
      /home/whyrusleeping/go/src/sync/waitgroup.go:63 +0xc1
  github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-ctxgroup.(*contextGroup).AddChildFunc()
      /home/whyrusleeping/gopkg/src/github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-ctxgroup/ctxgroup.go:168 +0x4e
  github.com/jbenet/go-ipfs/routing/dht.(*dhtQueryRunner).Run()
      /home/whyrusleeping/gopkg/src/github.com/jbenet/go-ipfs/routing/dht/query.go:110 +0x4cd
  github.com/jbenet/go-ipfs/routing/dht.(*dhtQuery).Run()
      /home/whyrusleeping/gopkg/src/github.com/jbenet/go-ipfs/routing/dht/query.go:59 +0xdd
  github.com/jbenet/go-ipfs/routing/dht.func·009()
      /home/whyrusleeping/gopkg/src/github.com/jbenet/go-ipfs/routing/dht/lookup.go:83 +0x11e

Goroutine 193 (running) created at:
  github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-ctxgroup.(*contextGroup).internalClose()
      /home/whyrusleeping/gopkg/src/github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-ctxgroup/ctxgroup.go:192 +0xba
  github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-ctxgroup.(*contextGroup).closeOnContextDone()
      /home/whyrusleeping/gopkg/src/github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-ctxgroup/ctxgroup.go:211 +0xad

Goroutine 115 (running) created at:
  github.com/jbenet/go-ipfs/routing/dht.(*IpfsDHT).GetClosestPeers()
      /home/whyrusleeping/gopkg/src/github.com/jbenet/go-ipfs/routing/dht/lookup.go:87 +0xc83
  github.com/jbenet/go-ipfs/routing/dht.(*IpfsDHT).Provide()
      /home/whyrusleeping/gopkg/src/github.com/jbenet/go-ipfs/routing/dht/routing.go:146 +0x451
  github.com/jbenet/go-ipfs/exchange/bitswap/network.(*impl).Provide()
      /home/whyrusleeping/gopkg/src/github.com/jbenet/go-ipfs/exchange/bitswap/network/ipfs_impl.go:138 +0xa4
  github.com/jbenet/go-ipfs/exchange/bitswap.(*bitswap).provideWorker()
      /home/whyrusleeping/gopkg/src/github.com/jbenet/go-ipfs/exchange/bitswap/workers.go:67 +0x374
  github.com/jbenet/go-ipfs/exchange/bitswap.func·011()
      /home/whyrusleeping/gopkg/src/github.com/jbenet/go-ipfs/exchange/bitswap/workers.go:32 +0x6f
  github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess.func·005()
      /home/whyrusleeping/gopkg/src/github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess/impl-mutex.go:96 +0xa7
==================
--- PASS: TestBitswapWithoutRouting (0.60s)
PASS
ok      github.com/jbenet/go-ipfs/test/integration  0.614s

@whyrusleeping
Copy link
Member Author

@jbenet im not very clear on the part of the codebase that race is in, do you have any insights?

@jbenet
Copy link
Member

jbenet commented Feb 27, 2015

not sure-- i think it's dht query runner / ctxgroup mix. may be fixed by switching to goprocess or there may be an actual problem

@whyrusleeping
Copy link
Member Author

Yeah, something in that race is why this test is hanging...

@whyrusleeping
Copy link
Member Author

Fixed by #834

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) topic/test failure Topic test failure
Projects
None yet
Development

No branches or pull requests

2 participants