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.
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
Adding disconnection reason and its use for ensuring better p2p performance #1154
Adding disconnection reason and its use for ensuring better p2p performance #1154
Changes from 161 commits
93060a2
f4371d3
5784ac5
d8ab5e2
9a1f07a
ee20bc9
4d873e2
81dd495
5518fbd
60a1845
97c2f34
639c739
6376be1
3ef8f92
85f6103
bfef982
90e47f4
1ace691
f5c21e4
b49534f
f1468d5
b5ed267
cbc1c2a
2588118
383e043
da0abb5
575c37c
df39f5e
b76b04d
8e2b0fa
8eda67d
4600839
59e4f0d
082d785
aa2ea6d
e46d02e
1e1aedf
0561c32
226481a
0100068
07d98fb
a34254b
1dff642
2d96b3f
5b29aaf
b481a03
a9bf799
c9b52d6
d3bd21b
aee96f8
b514efe
ee3509f
7afa712
6636ce8
8e46b44
ecbbdc9
ccb3f67
7b1a363
b0a4165
298c7da
4dd37bb
cf6037f
d11bab2
138eeb9
bb9bb74
ee21124
a156012
827c7bd
f1ab573
59432fc
1b701b8
f0f922d
967de15
6b7db44
ae78293
6adc3da
a208484
e5022b7
64e01fb
76b60bc
66eb08a
34d5534
49c4267
cb75a76
9d14691
86efb94
3ab636c
817ba9b
6b06c23
eb23c1d
39f6559
a370743
8805ce6
50a8b60
5a6bf5e
c4b06e0
d67357d
a4aba34
bc6c977
a492163
cd4d6b9
f7a1fe2
f566864
ab487a6
28b7349
7ebe9cc
7821961
47e0935
fe0319a
3e4aee4
9957793
fc68609
5c3f26c
29becc0
3261c50
568bea7
3605a85
76a25cd
de89b48
b465fac
7557099
f1cfc84
46d8894
f3e9a9b
7e8bf18
4b0b0dc
c35f038
1744b5f
2642400
620ec27
1a476cf
eacfef5
e85698d
29ed287
34dedbc
bc1135e
a8cc787
9409fe2
3ab6a92
65d4128
0fb51cb
8e9ddb3
ff7c040
829c41c
4af40c1
c1710e1
2a6aa64
1aace70
05b1cfd
a3e2818
bd3bf6c
fa5ce65
07934f6
55e654f
19a145c
04ea624
fb29add
e93907f
b56613b
615fcda
e07724b
5b637c6
857c2f6
3beb4b8
0f714dd
626bc8c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This foreach loop could be avoided by adjusting the data structures.
The Peer has the ConnectedAddresses map, if we need to be able to map from addresses to remote nodes maybe that relationship should be modeled.
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.
Here we are filtering duplicate connections through two attributes: nonce, Address.
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.
Why do you send this message?
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.
We need to register the handler, otherwise we can't send the error message back.
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.
Get it. But then it should be sent in
LocalNode
. Because thePeer
doesn't send the message when disconnecting.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.
No, we also need to send the register message in normal case#L233
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.
But we don't need to send
Register
when it is disconnecting.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.
The disconnection reason is sent in
LocalNode
.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, we send reason message in LocalNode, and create reason in Peer, as we have abstract the
TcpDisconnect
. I think it's okay to putSender.Tell(new Tcp.Register(connection));
here, which is part of the akka handshake protocol.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.
It's illogical that register an actor and then close it immediately.
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.
We also want a better way, like HTTP various status codes, but akka doesn't support it, and we also want to carry the address list information.
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.
@erikzhang, perhaps it is reaching the time to merge this PR for us to start testing it together with other daily routines.