-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
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
|
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. |
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.
Is it difficult to write a test that exposes this behaviour?
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.
Yes
seems we try to fix same issue #3361 |
Ok let's close this for #3361 (comment) and figure out how to fix from there |
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