Attempt Pending Request to BUSY && ASSIGNED && DISCONNECTED Peer #1321
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.
Any process that depends on pre-assigned peer tasks is liable to grow our
pendingRequests
out of control.When we attempt to execute a pending transaction, we check for that peers availability:
besu/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/PendingPeerRequest.java
Lines 62 to 68 in bac5c67
However, if that peer was disconnected while there were max outstanding requsts, we'll never reattempt it as
selectedPeer
will be empty. Furthermore, we'll return false and keep that pending request in our list of requests.With this change we indicate that we aren't waiting for any outstanding requests when we disconnect from a peer, allowing the existing logic that triggers when peers are disconnected to be hit.
The getter I added just for testing purposes was to get around the inadequecies of the
MockPeerConnection
. There's a whole lot of callback plumbing that's needed for a simpleethPeer.disconnect
to do the same thing it does when we call it in our production code.