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

asyncio runner discards KI of payloads #114

Merged
merged 2 commits into from
Jul 29, 2022
Merged

Conversation

maxfischer2781
Copy link
Member

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
Copy link

codecov bot commented Jul 28, 2022

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%) ⬆️

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.

@maxfischer2781 maxfischer2781 requested review from a team, giffels and eileen-kuehn and removed request for a team July 28, 2022 14:45
Copy link
Member

@giffels giffels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easy enough! Thanks for your contribution!

Copy link
Member

@eileen-kuehn eileen-kuehn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks! 👍

@maxfischer2781 maxfischer2781 merged commit ae4926c into master Jul 29, 2022
@maxfischer2781 maxfischer2781 added this to the Release 0.13 milestone Aug 16, 2022
@maxfischer2781 maxfischer2781 deleted the maintenance/asyncio_ki branch January 17, 2024 15:02
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.

3 participants