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

fix(identify): push should not dial a new connection #3035

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

MarcoPolo
Copy link
Collaborator

@MarcoPolo MarcoPolo commented Nov 12, 2024

There is a small window after a peer disconnects, but before identify has updated its conn map that would cause the host to dial a peer in order to send a push message. This prevents that

@MarcoPolo MarcoPolo requested a review from sukunrt November 12, 2024 03:57
@MarcoPolo MarcoPolo self-assigned this Nov 12, 2024

// We only want to send an identify push if we already have an open
// connection.
ctx = network.WithNoDial(ctx, "id push")
str, err := ids.Host.NewStream(ctx, c.RemotePeer(), IDPush)
Copy link
Member

Choose a reason for hiding this comment

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

Should we create the stream explicitly on the connection and do multistream select explicitly like we do for identify(non push). This might use a different connection to open the stream.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, that's better. done on b53c174

@MarcoPolo MarcoPolo changed the title fix: identify: push should not dial a new connection fix(identify): push should not dial a new connection Nov 18, 2024
@MarcoPolo MarcoPolo merged commit 708eb30 into master Nov 18, 2024
11 checks passed
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