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

clean up messy defer logic in IDService.sendIdentifyResp #1169

Merged
merged 1 commit into from
Aug 27, 2021

Conversation

marten-seemann
Copy link
Contributor

I believe we don't need to hold the lock while closing the stream.

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.

I really can't remember why we did it this way...

p2p/protocol/identify/id.go Show resolved Hide resolved
@Stebalien
Copy link
Member

Actually, no, this is still wrong. We should be extracting the snapshot, then sending it, not holding the lock while we write to a stream.

@marten-seemann
Copy link
Contributor Author

We should be extracting the snapshot, then sending it, not holding the lock while we write to a stream.

Yeah, that's better.

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.

❤️

@Stebalien Stebalien merged commit 15993ee into master Aug 27, 2021
@marten-seemann marten-seemann deleted the clean-up-send-identify-resp branch August 28, 2021 12:26
@aschmahmann aschmahmann mentioned this pull request Dec 1, 2021
80 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