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 deadlock in the transport's serve function #35

Merged
merged 2 commits into from
Jul 25, 2021

Conversation

marten-seemann
Copy link
Contributor

@marten-seemann marten-seemann commented Jul 24, 2021

We don't close the connection before the echo hasn't returned, but echo won't return before AcceptStream has returned an error, which only happens when the connection is closed.

This is what causes the failure with go-tcp-transport (libp2p/go-tcp-transport#85).

We don't close the connection before the echo hasn't returned, but echo won't
return before AcceptStream has returned an error, which only happens when the
connection is closed.
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

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

Nice catch!

Not critical, but we may want to do this on the dial side as well:

.

Really, we only need to do it on one side, but it can't hurt.

@marten-seemann marten-seemann merged commit 31e179c into master Jul 25, 2021
@marten-seemann marten-seemann deleted the fix-serve-deadlock branch July 25, 2021 08:04
@aschmahmann aschmahmann mentioned this pull request Aug 23, 2021
62 tasks
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