-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement state sharing priority (#415)
Previously, peers would download state from an (effectively) random existing peer. As a result, sometimes if many peers got out of sync, they would re-download state from another out-of-sync peer for many times before they got it right. This PR prioritizes downloading state from "latest" peers, depending on the optimizer. Note: an intermediate version of this PR used a multiprocessing.Event to trigger re-declaring priority to the DHT. However, this turned out to **harm test performance for py39**. The slowdown was caused specifically by this one line: `await loop.run_in_executor(None, mp_event.wait, timeout_here)` in _declare_for_download_periodically. Other python versions are not affected. I have no idea why py39 reacts like this, but i ended up switching away from MP events just in case. Co-authored-by: Aleksandr Borzunov <[email protected]>
- Loading branch information
1 parent
50ab48e
commit 00538db
Showing
4 changed files
with
89 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters