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

fetcher does not ensure peer is connected before requesting #4938

Closed
countvonzero opened this issue Aug 31, 2023 · 0 comments
Closed

fetcher does not ensure peer is connected before requesting #4938

countvonzero opened this issue Aug 31, 2023 · 0 comments

Comments

@countvonzero
Copy link
Contributor

Description

code https://github.com/spacemeshos/go-spacemesh/blob/develop/fetch/fetch.go#L486-L490

for _, req := range requests {
		p, exists := f.hashToPeers.GetRandom(req.Hash, req.Hint, rng)
		if !exists {
			p = randomPeer(peers)
		}
                ...
}

it gets random peers that registered as hash providers, but it doesn't check if we are connected with that peer.
so for example on my computer i loop with for almost 20 minutes.

2023-08-31T08:41:17.708+0200 WARN fd68b.fetcher failed to fetch blocks {"node_id": "fd68b9397572556c2f329f3e5af2faf23aef85dbbbb7e38447fae2f4ef38899f", "module": "fetcher", "error": "hint: blocksDB, hash: 0xa7fda17e3b073d66aa94e251207faca321e39e7f000000000000000000000000, err: batched request failed w retries: peer is not connected: 12D3KooWCdy5ELnzUoA8kDzG26444DqjSjbNgGMKT3fHPJo7oLmP"}
...
2023-08-31T08:58:01.793+0200 WARN fd68b.fetcher failed to fetch blocks {"node_id": "fd68b9397572556c2f329f3e5af2faf23aef85dbbbb7e38447fae2f4ef38899f", "module": "fetcher", "error": "hint: blocksDB, hash: 0xa7fda17e3b073d66aa94e251207faca321e39e7f000000000000000000000000, err: batched request failed w retries: peer is not connected: 12D3KooWCdy5ELnzUoA8kDzG26444DqjSjbNgGMKT3fHPJo7oLmP"}

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 a pull request may close this issue.

1 participant