Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minor asyncio issues in averager #356

Merged
merged 5 commits into from
Aug 20, 2021
Merged

Fix minor asyncio issues in averager #356

merged 5 commits into from
Aug 20, 2021

Conversation

borzunov
Copy link
Member

This fixes minor asyncio issues in averager found while debugging #351:

  1. Make averager not fail during reporting an error if the recipient closes the connection before receiving it (e.g. if it has crashed itself). Example:

    2021-08-21 03 25 57

  2. Support asyncio cancellation and shutdown in _load_state_from_peers, that is don't suppress asyncio.CancelledError and GeneratorExit. For example, this happens when GeneratorExit is suppressed:

    2021-08-21 03 26 02

  3. Remove excess calls of __aiter__()/__anext__() (outside hivemind.utils.asyncio, we can always manage with anext(), so let's not scare the code readers with these magic methods)

@borzunov borzunov requested a review from justheuristic August 20, 2021 22:27
@codecov
Copy link

codecov bot commented Aug 20, 2021

Codecov Report

Merging #356 (3789b7e) into master (4da80bc) will increase coverage by 0.18%.
The diff coverage is 83.33%.

@@            Coverage Diff             @@
##           master     #356      +/-   ##
==========================================
+ Coverage   83.19%   83.38%   +0.18%     
==========================================
  Files          66       66              
  Lines        5994     6002       +8     
==========================================
+ Hits         4987     5005      +18     
+ Misses       1007      997      -10     
Impacted Files Coverage Δ
hivemind/averaging/allreduce.py 77.70% <0.00%> (ø)
hivemind/averaging/averager.py 84.73% <0.00%> (ø)
hivemind/averaging/matchmaking.py 84.98% <ø> (+1.20%) ⬆️
hivemind/p2p/p2p_daemon.py 97.01% <100.00%> (+0.04%) ⬆️
hivemind/utils/asyncio.py 95.89% <100.00%> (+1.68%) ⬆️
hivemind/dht/node.py 92.60% <0.00%> (+1.19%) ⬆️

@borzunov borzunov merged commit f97b742 into master Aug 20, 2021
@borzunov borzunov deleted the fix-asyncio-errors branch August 20, 2021 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants