Skip to content
Snippets Groups Projects

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

Closed pini requested to merge pini into dev
All threads resolved!

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
  • pini added 1 commit

    added 1 commit

    • 0339a2be - fix(sync): don't lose nodes on single download err

    Compare with previous version

  • pini added 1 commit

    added 1 commit

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

    Compare with previous version

  • Author Developer

    @librelois Comment puis-je accéder à à la log prettier ? C'est ce qui fait planter le pipeline si je comprends correctement :

    > duniter@1.8.1 format:check /builds/nodes/typescript/duniter
    > prettier --list-different 'app/**/*.{ts,json}'
    app/modules/daemon.ts
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! duniter@1.8.1 format:check: `prettier --list-different 'app/**/*.{ts,json}'`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the duniter@1.8.1 format:check script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/user/.npm/_logs/2021-05-14T18_29_50_861Z-debug.log
  • Faut juste formatter ton code avec la commande npm run format:all :)

  • pini added 2 commits

    added 2 commits

    • 1da403bc - feat: configure loglevel with env var
    • a2b03fcf - fix(sync): don't lose nodes on single download err

    Compare with previous version

  • Author Developer

    Merci. Ça a modifié une tonne de trucs. Mais en ne retenant que ce qui concernait mes commits c'est passé.

  • Éloïs
  • Éloïs
  • closed

  • Éloïs resolved all threads

    resolved all threads

  • Please register or sign in to reply
    Loading