MatterMiners / cobald

Cobald is an Opportunistic Balancing Deamon
https://cobald.readthedocs.io
MIT License
11 stars 12 forks source link

asyncio runner discards KI of payloads #114

Closed maxfischer2781 closed 2 years ago

maxfischer2781 commented 2 years ago

This PR adjusts cleanup of tasks by the asyncio runner. This allows payloads/services to die/abort with an explicit raise KeyboardInterrupt without triggering a Task exception was never retrieved warning.

An unhandled KeyboardInterrupt gracefully stops the event loop, similar to how it stops regular synchronous programs. However, asyncio considers a task killed this way still as exceptionally terminated and will issue a warning if the exception has not been retrieved. The changes of this PR ensure that the asyncio runner takes care of retrieving all such exceptions from it own tasks.

codecov[bot] commented 2 years ago

Codecov Report

Merging #114 (1191799) into master (a5a1fbc) will increase coverage by 0.18%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #114      +/-   ##
==========================================
+ Coverage   92.55%   92.73%   +0.18%     
==========================================
  Files          34       34              
  Lines        1141     1143       +2     
  Branches      167      166       -1     
==========================================
+ Hits         1056     1060       +4     
+ Misses         61       60       -1     
+ Partials       24       23       -1     
Impacted Files Coverage Δ
src/cobald/daemon/runners/asyncio_runner.py 97.82% <100.00%> (+4.64%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a5a1fbc...1191799. Read the comment docs.