-
Notifications
You must be signed in to change notification settings - Fork 112
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
feat(session): do not record erroneous session want sends #452
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
@@ Coverage Diff @@
## main #452 +/- ##
==========================================
+ Coverage 60.42% 60.44% +0.01%
==========================================
Files 245 245
Lines 31056 31064 +8
==========================================
+ Hits 18766 18777 +11
+ Misses 10621 10616 -5
- Partials 1669 1671 +2
|
seems reasonable, aside from probably needing some form of cleanup for cases where the error doesn't ever resolve - we don't want to continue to try this in perpetuity, unless there is already an alternative cleanup mechanism in place for these wants |
Presumably, the case where the error does not resolve is one where a peer has disconnected, in which case, we will eventually get a disconnected message. |
86a7a45
to
eedee67
Compare
d3e88f1
to
643278e
Compare
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. Let's try it out.
Goals
Find acceptable fix for #432
Implementation
The basic idea here is there's nothing wrong with the connection event manager -- the problem lies in the fact that the PeerManager never tells the caller it didn't actually send anything cause the peer appeared disconnected. The SessionWantSender in turn updates the state of sent wants based on incorrect assumption something actually happened. This PR deals with the problem by helping the SessionWantSender avoid getting into an incorrect state by not updating its state when SendWants does nothing.
The subsequent connect event should trigger the sending of the WantBlock then.
For discussion
This is just an experiment and a suggestion for someone else to pick up, to help solve #432 more quickly -- I'm not doing the leg work of testing and change log etc