-
Notifications
You must be signed in to change notification settings - Fork 64
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 unexpected ConnectionDirection update #188
Conversation
Co-authored-by: Divma <[email protected]>
Co-authored-by: Divma <[email protected]>
@AgeManning @divagant-martian Please have a look when you have time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a first review, it seems like we could leave the handler as it is, then in the service, we never update the direction of a node in the routing table, we only ever set the direction for a new node.
This way the code changes would be minimal, and the initial connections are kept as final (until the node is exited from the routing table).
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this change in the right direction but I missed something on the first review that changes the point of the PR
@AgeManning @divagant-martian I have tested again with the latest changes, and that was fine. 🙆♂️ Please have another look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, missing a typo
Fix typo Co-authored-by: Divma <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah nice, looks good.
Much simpler :)
Description
A connection direction can unexpectedly change from Outgoing to Incoming in the scenario shown in this diagram. The diagram shows a specific case in PING/PONG. However, if we generalize this, when an
Outgoing
connection is established and the other node returns WHOAREYOU, the ConnectionDirection will change toIncoming
at the time the new session is established. This could potentially cause some problems. e.g. IpVote doesn't work as IpVote ignores Incoming connections.This PR makes the service to set only initial connection direction and not update it if a node already exists in the routing table.
Notes & open questions
I have tested this PR with the PING/PONG simulation (#184), and confirmed that the Outgoing connection directions are kept.
Change checklist