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
p2p/conn: FlushStop. Use in pex. Closes #2092 #2802
Merged
Merged
Conversation
This file contains 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
ebuchman
force-pushed
the
bucky/2092-flush-stop
branch
from
November 11, 2018 01:42
66e2916
to
6f1bfe9
Compare
In seed mode, we call StopPeer immediately after Send. Since flushing msgs to the peer happens in the background, the peer connection is often closed before the messages are actually sent out. The new FlushStop method allows all msgs to first be written and flushed out on the conn before it is closed.
melekes
reviewed
Nov 11, 2018
Codecov Report
@@ Coverage Diff @@
## develop #2802 +/- ##
==========================================
+ Coverage 62.28% 62.3% +0.02%
==========================================
Files 212 212
Lines 17182 17253 +71
==========================================
+ Hits 10702 10750 +48
- Misses 5582 5603 +21
- Partials 898 900 +2
|
This was referenced Nov 11, 2018
jaekwon
reviewed
Nov 11, 2018
jaekwon
reviewed
Nov 11, 2018
jaekwon
reviewed
Nov 11, 2018
melekes
reviewed
Nov 12, 2018
FlushStop is not safe to call more than once, but we call it from Receive in a go-routine so Receive doesn't block. To ensure we only call it once, we use the lastReceivedRequests map - if an entry already exists, then FlushStop should already have been called and we can return.
melekes
approved these changes
Nov 16, 2018
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.
🍃 🌴 🌤
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.
In seed mode, we call StopPeer immediately after Send.
Since flushing msgs to the peer happens in the background,
the peer connection is often closed before the messages are
actually sent out. With FlushStop, we allow all msgs to first be written and flushed out
on the conn before it is closed.
This should be a proper solve for this issue, to replace https://github.com/tendermint/tendermint/pull/2797/files#diff-8c6b1a350a161ced01d68514ccda7484R224
Closes #2092