Sending to many peers can be tolerant of failures #160
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.
This PR makes a slight change to how
sendToMany()
operates.Before, we were strict in how we treat errors - failing to send message even to a single peer meant we treated the whole operation as a failure. Also, if send to n-th peer failed - we did not even try peers that are after it in the list.
This caused problems in cases where we might have flaky peers that do reply to a roll call but might drop off afterwards, pulling down the whole operation with it. Additionally, we were sending messages sequentially.
Now, we parallelize sends, and also tolerate partial send failures, similar to how we treat waiting for execution responses - we might not get everyone. This goes for non-consensus executions at the moment. For consensus we still require all peers get the message.
Also - if ALL sends fail - we do treat that as an error.