do not panic if the peer does not have a state in Receive#3346
Closed
do not panic if the peer does not have a state in Receive#3346
Conversation
Peer does not have a state yet. We set it in AddPeer, but because the peer is started before we add it to reactors, we can receive a message before AddPeer is called. Refs #3304
Codecov Report
@@ Coverage Diff @@
## develop #3346 +/- ##
===========================================
- Coverage 64.03% 64.01% -0.03%
===========================================
Files 215 215
Lines 17738 17725 -13
===========================================
- Hits 11358 11346 -12
+ Misses 5452 5445 -7
- Partials 928 934 +6
|
liamsi
reviewed
Feb 22, 2019
| panic(fmt.Sprintf("Peer %v has no state", src)) | ||
| // Peer does not have a state yet. We set it in AddPeer, but because the | ||
| // peer is started before we add it to reactors, we can receive a message | ||
| // before AddPeer is called. |
Contributor
There was a problem hiding this comment.
Is it difficult to write a test that exposes this behaviour?
4 tasks
Contributor
|
seems we try to fix same issue #3361 |
Contributor
|
Ok let's close this for #3361 (comment) and figure out how to fix from there |
4 tasks
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.
Peer does not have a state yet. We set it in AddPeer, but because the
peer is started before we add it to reactors, we can receive a message
before AddPeer is called.
Refs #3304