various identify fixes and nits#922
Merged
aarshkshah1992 merged 12 commits intomasterfrom May 14, 2020
Merged
Conversation
e8938d2 to
3949a83
Compare
* Always send the correct observed addr for the connection being identified. * Always send the correct addresses for the connection being identified. * Avoid extra work when the remote peer doesn't support identify delta. * Instead of applying delta locally, just update the snapshot with the new protocols. * Always access the snapshot under a lock and get rid of the test channel. This doesn't cost us in terms of performance and makes the system easier to reason about.
3949a83 to
355fd08
Compare
Contributor
|
(rebased). |
Contributor
|
@Stebalien Good stuff. LGTM ! |
raulk
reviewed
May 19, 2020
Comment on lines
194
to
198
| if ids.Host.Network().Connectedness(rp) == network.Connected { | ||
| mes := &pb.Identify{} | ||
| ids.populateMessage(mes, rp, addReq.localConnAddr, addReq.remoteConnAddr) | ||
| ph = newPeerHandler(rp, ids, mes) | ||
| ph = newPeerHandler(rp, ids) | ||
| ph.start() | ||
| phs[rp] = ph | ||
| addReq.resp <- ph |
Member
There was a problem hiding this comment.
If the peer disconnects between the time when the other goroutine sent into this one and now, we will never respond on the resp channel and we'll have a goroutine leak.
Member
Author
There was a problem hiding this comment.
Hm. You're right. We need to send something back then reset the stream, I guess.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
My fingers got itchy to write some code.