Skip to content
Snippets Groups Projects

fix(sync): don't lose nodes on single download err

Closed pini requested to merge pini-dont-loose-node-on-single-error-when-syncing into release/1.8

This is a cherry-pick of commit 7a59f46f from branch dev. This should help with synchronizing.

P2pCandidate.dlPromise promise doesn't resolve on download errors such as socket timeouts. Each time such an error occurs, the node is lost for the sync because the 'this.dlPromise.isResolved()' check used for testing the node's availability never succeeds anymore for this node.

This patch hardens the blocks downloading in two ways:

  • Retrying the download up to 5 times when the number of returned blocks is different from what was requested
  • On failure returns an empty block array so that the dlPromise is resolved and the node failure could be handled as expected at the P2PSyncDownloader level triggering the P2pCandidate.addFailure() function.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading