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

don't close the connection when opening the identify stream fails #1293

Merged
merged 2 commits into from
Jan 10, 2022

Conversation

marten-seemann
Copy link
Contributor

This is obviously very important once the rcmgr is used. This PR also cleans up some rather messy defer logic that was used for error handling.

Copy link
Contributor

@vyzo vyzo left a comment

Choose a reason for hiding this comment

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

I would also ask for @Stebalien 's opinion here as well, as this might have interesting effects up the stack.


s, err = c.NewStream(network.WithUseTransient(context.TODO(), "identify"))
func (ids *idService) identifyConn(c network.Conn) error {
s, err := c.NewStream(network.WithUseTransient(context.TODO(), "identify"))
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldnt we have a timeout here? Or do we set the deadline?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's do that in a separate PR. We do set a bunch of deadlines, but only read deadlines, which can lead to funny edge cases if the peer withholds flow control credit.

@marten-seemann marten-seemann merged commit d50ba5f into master Jan 10, 2022
@marten-seemann
Copy link
Contributor Author

Oh damn, I merged this PR accidentally. Sorry for that. I'm happy to revert / fix in a follow-up PR if necessary.

@vyzo
Copy link
Contributor

vyzo commented Jan 10, 2022

thats fine, i was going to approve anyway. I still want @Stebalien 's opinion on this however.

@marten-seemann marten-seemann deleted the identify branch January 10, 2022 19:08
@Stebalien
Copy link
Member

Currently, this will mark the function as "identified" instead of trying again in the future.

  1. It would be nice if IdentifyWait returned an error, but that's probably not necessary.
  2. We should definitely remove the channel from ids.conns if identify fails so we try again next time.

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.

3 participants