-
Notifications
You must be signed in to change notification settings - Fork 77
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
Network conn overflow and shutdown #691
Conversation
(*Peer).Disconnect send an unregister signal to this goroutine, so invoking it from here is not a good idea, run it asynchronously.
40ae09f
to
4e0e7eb
Compare
Codecov Report
@@ Coverage Diff @@
## master #691 +/- ##
==========================================
+ Coverage 65.01% 65.05% +0.03%
==========================================
Files 125 125
Lines 10820 10833 +13
==========================================
+ Hits 7035 7047 +12
- Misses 3505 3506 +1
Partials 280 280
Continue to review full report at Codecov.
|
@@ -34,6 +35,7 @@ type DefaultDiscovery struct { | |||
connectedAddrs map[string]bool | |||
goodAddrs map[string]bool | |||
unconnectedAddrs map[string]int | |||
isDead bool |
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.
Not the most elegant solution, but with the current design I'm not sure anything better is possible (absent this kludge we'll panic on RequestRemote
after Close
).
4e0e7eb
to
ccffe2f
Compare
Codecov Report
@@ Coverage Diff @@
## master #691 +/- ##
==========================================
+ Coverage 65.01% 65.04% +0.02%
==========================================
Files 125 125
Lines 10820 10835 +15
==========================================
+ Hits 7035 7048 +13
- Misses 3505 3507 +2
Partials 280 280 Continue to review full report at Codecov.
|
ccffe2f
to
815436c
Compare
Close transport and disconnect peers right in the Shutdown(), so that no new connections would be accepted and so that all the peers would be disconnected correctly (avoiding the same deadlock as in e2116e4).
815436c
to
e213e69
Compare
Problem
Deadlocks on connection overflow and server shutdown.
Solution
Merge button.