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

swarm: fix stale DialBackoff comment #2353

Merged
merged 1 commit into from
Jun 12, 2023

Conversation

sukunrt
Copy link
Member

@sukunrt sukunrt commented Jun 12, 2023

Removes comment suggesting we dial an address via one goroutine when it's on backoff. We do not do so.
Removes old code snippets.

@sukunrt sukunrt changed the title swarm: fix state DialBackoff comment swarm: fix stale DialBackoff comment Jun 12, 2023
@sukunrt sukunrt force-pushed the sukun/fix-dialbackoff-comment branch from 107b501 to 075577c Compare June 12, 2023 09:43
@sukunrt sukunrt force-pushed the sukun/fix-dialbackoff-comment branch from 075577c to f946428 Compare June 12, 2023 09:46
// addresses of a peer, we add the addresses to DialBackoff. Then, whenever we
// attempt to dial the peer again, we check each address for backoff. If it's on
// backoff, we don't dial the address and exit promptly. If a dial is
// successful, the peer and all its addresses are removed from backoff.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we? That's probably something we should clean up at some point...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming you mean if we clear the backoffs on success. We remove the peer from the backoff map effectively clearing all addresses.
https://github.com/libp2p/go-libp2p/blob/v0.27.0/p2p/net/swarm/swarm.go#L320

@marten-seemann marten-seemann merged commit 046f112 into master Jun 12, 2023
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 this pull request may close these issues.

2 participants