-
Notifications
You must be signed in to change notification settings - Fork 880
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
Peering - disconnects refactor #6968
Changes from 22 commits
4ced6a0
2d4badf
632a3e0
3dccfaf
bb695b5
b275d52
de4db90
d9e840f
ad927c3
f808a72
f623e72
6afebd3
40405a3
ab1809c
60aa98d
e02c1ab
5fa7599
9857dce
7d29573
a2d8181
d40cfaf
2871bea
0f82c92
3420cc3
fdc4099
428c5d6
cd6a448
be1b2d7
7859906
1dc6f15
6c66577
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,7 +215,7 @@ public void recordRequestTimeout(final int requestCode) { | |
.addArgument(this::getLoggableId) | ||
.log(); | ||
LOG.trace("Timed out while waiting for response from peer {}", this); | ||
reputation.recordRequestTimeout(requestCode, this).ifPresent(this::disconnect); | ||
reputation.recordRequestTimeout(requestCode, this); | ||
} | ||
|
||
public void recordUselessResponse(final String requestType) { | ||
|
@@ -224,7 +224,7 @@ public void recordUselessResponse(final String requestType) { | |
.addArgument(requestType) | ||
.addArgument(this::getLoggableId) | ||
.log(); | ||
reputation.recordUselessResponse(System.currentTimeMillis(), this).ifPresent(this::disconnect); | ||
reputation.recordUselessResponse(System.currentTimeMillis(), this); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s.a. |
||
} | ||
|
||
public void recordUsefulResponse() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,6 +132,7 @@ private Stream<EthPeer> remainingPeersToTry() { | |
} | ||
|
||
private void refreshPeers() { | ||
// TODO this duplicates EthPeers.disconnectWorst | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at line 141, I think we could just not filter on !is.disconnected? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
final EthPeers peers = getEthContext().getEthPeers(); | ||
// If we are at max connections, then refresh peers disconnecting one of the failed peers, | ||
// or the least useful | ||
|
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.
I think that we should disconnect these, because otherwise we might waist time by using these peers for requests, because they are likely to timeout as well.