-
Notifications
You must be signed in to change notification settings - Fork 786
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix work_cancel not being sent and some unreachable peers hanging the requests * Start local work generation along with work peer requests * Work cancel done in a new socket * Log if work generation cannot be performed * Making sure stop is only called once * Simplifying connection handling * Fix bad address from unordered map * Stop on destructor * Correctly stopping work generation on node stop * Use atomic<bool> and exchange * node.work is not stopped on node.stop due to testing setup * Local work generation is now only used in case peers are unresponsive This change enhances the previous behavior. Local work generation is only used after all peers are unresponsive. A flag is set in the node (unresponsive_work_peers) so that for the next distributed work, local generation will start immediately. Work peer requests are still sent, and as soon as one replies with valid work, local generation is delayed again, until all are unresponsive, and so on. This is more of a fallback mechanism when all peers are failing, as the previous behavior would always wait for timeouts on peers (which can be long, 2 minutes here). The only case not handled for simplicity is when multiple work is queued, and the first one has unresponsive peers. In this case, the currently queued work requests will not start work generation immediately, only for the next queued distributed work. * Also start local generation immediately if there are no work peers * Robustify * Unbreak tests * No need to wrap in node background
- Loading branch information
1 parent
20b52ac
commit ddf4d66
Showing
3 changed files
with
169 additions
and
107 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
Oops, something went wrong.