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

swarm/network/stream: fix delivery test errors #1170

Closed
wants to merge 3 commits into from
Closed

Conversation

janos
Copy link
Member

@janos janos commented Jan 29, 2019

This PR should fix stream capability problems reported on travis https://travis-ci.org/ethersphere/go-ethereum/jobs/485364722#L808.

ERROR[01-28|12:13:08.749|swarm/network/stream/delivery.go:266] Delivery.RequestFromPeers: peer doesn't have stream cap. we should have returned at sp == nil 
ERROR[01-28|12:13:18.259|swarm/network/stream/peer.go:91]      Message send error, dropping peer        peer=c23331d32a5c1e2c err="shutting down"
ERROR[01-28|12:13:18.259|swarm/network/stream/peer.go:91]      Message send error, dropping peer        peer=c23331d32a5c1e2c err="shutting down"
ERROR[01-28|12:13:18.259|swarm/network/stream/peer.go:91]      Message send error, dropping peer        peer=c23331d32a5c1e2c err="shutting down"
ERROR[01-28|12:13:18.801|swarm/network/stream/delivery.go:266] Delivery.RequestFromPeers: peer doesn't have stream cap. we should have returned at sp == nil 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x90327d]
goroutine 167 [running]:
github.com/ethereum/go-ethereum/swarm/network.(*Fetcher).doRequest(0xc002074200, 0xcca740, 0xc00024fe00, 0xc002034480, 0xc0012faf00, 0x0, 0x0, 0x0, 0x1, 0x0, ...)
	/home/travis/gopath/src/github.com/ethereum/go-ethereum/swarm/network/fetcher.go:307 +0x25d
github.com/ethereum/go-ethereum/swarm/network.(*Fetcher).run(0xc002074200, 0xcca740, 0xc00024fe00, 0xc0012faf00)
	/home/travis/gopath/src/github.com/ethereum/go-ethereum/swarm/network/fetcher.go:231 +0x4b8
created by github.com/ethereum/go-ethereum/swarm/network.(*FetcherFactory).New
	/home/travis/gopath/src/github.com/ethereum/go-ethereum/swarm/network/fetcher.go:114 +0x12f
FAIL	github.com/ethereum/go-ethereum/swarm/network/stream	10.124s

The problem is that in swarm/network/stream tests we do not have "stream" capability for nodes, but in RequestFromPeers method check for it. This is not a problem on production since every peer that is in Registry.peers must have "stream" capability, which is guaranteed by the p2p package. So this check can be safely removed.

I was not able to reproduce the issue locally, only on Travis, and with this change, multiple travis runs did not produce any errors.

@janos janos self-assigned this Jan 29, 2019
@janos janos changed the title swarm/network/stream: TestRequestFromPeersWithLightNode set stream cap swarm/network/stream: fix delivery test errors Jan 29, 2019
@janos
Copy link
Member Author

janos commented Jan 30, 2019

Submitted upstream ethereum/go-ethereum#18971.

@janos janos closed this Jan 30, 2019
@janos janos deleted the delivery-test-cap branch September 30, 2019 10:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants