aiohttp icon indicating copy to clipboard operation
aiohttp copied to clipboard

Add clarification about `GracefulExit` when using `handle_signals=True`

Open Daste745 opened this issue 2 years ago • 8 comments

What do these changes do?

Clarify that GracefulExit needs to be handled manually when using handle_signals=True in AppRunner and ServerRunner.

Are there changes in behavior for the user?

N/A

Related issue number

Fixes #4414

Checklist

  • [ ] I think the code is well written
  • [ ] Unit tests for the changes exist
  • [ ] Documentation reflects the changes
  • [ ] If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • [x] Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

Daste745 avatar Oct 23 '22 10:10 Daste745

The issue #4414 is quite old, but I think this still needed addressing. I added a short mention about the need to handle GracefulExit signals in the handle_signals param description. If this is not enough, I could expand it to a 'Note' or 'Warning' section.

Daste745 avatar Oct 23 '22 10:10 Daste745

I'll let @webknjaz look over it, as it was his issue.

Dreamsorcerer avatar Oct 23 '22 11:10 Dreamsorcerer

Codecov Report

Merging #7043 (f2a6ffd) into master (12f56d7) will not change coverage. The diff coverage is n/a.

:exclamation: Current head f2a6ffd differs from pull request most recent head ed1f0e0. Consider uploading reports for the commit ed1f0e0 to get more accurate results

@@           Coverage Diff           @@
##           master    #7043   +/-   ##
=======================================
  Coverage   97.50%   97.50%           
=======================================
  Files         103      103           
  Lines       29972    29972           
  Branches     3640     3640           
=======================================
  Hits        29224    29224           
  Misses        567      567           
  Partials      181      181           
Flag Coverage Δ
CI-GHA 97.40% <ø> (ø)
OS-Linux 97.04% <ø> (-0.01%) :arrow_down:
OS-Windows 95.39% <ø> (ø)
OS-macOS 96.68% <ø> (-0.01%) :arrow_down:
Py-3.10.8 97.16% <ø> (-0.07%) :arrow_down:
Py-3.11.0 96.55% <ø> (ø)
Py-3.11.0-rc.2 ?
Py-3.7.15 96.88% <ø> (ø)
Py-3.7.9 95.27% <ø> (ø)
Py-3.8.10 95.17% <ø> (-0.01%) :arrow_down:
Py-3.8.14 96.78% <ø> (ø)
Py-3.9.13 95.16% <ø> (+<0.01%) :arrow_up:
Py-3.9.14 96.57% <ø> (ø)
Py-3.9.15 96.80% <ø> (ø)
Py-pypy7.3.9 96.43% <ø> (-0.01%) :arrow_down:
VM-macos 96.68% <ø> (-0.01%) :arrow_down:
VM-ubuntu 97.04% <ø> (-0.01%) :arrow_down:
VM-windows 95.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Oct 23 '22 11:10 codecov[bot]

Cool, thanks!

webknjaz avatar Oct 26 '22 17:10 webknjaz

We've got some CI errors, probably because GracefulExit doesn't have any section in the docs and the linter can't create a reference. I don't see an obvious place to put more information about GracefulExit, as it's only used for this one purpose.

Daste745 avatar Oct 27 '22 13:10 Daste745

Hmm, should it be added to the reference section then? Previously, it was considered a private inner working of the library, and not meant to be used by a user. But, if we are now expecting users to catch the exception, then maybe it needs to be documented as part of the public API now..

Dreamsorcerer avatar Oct 27 '22 17:10 Dreamsorcerer

I agree. I'll try to find a place to document the GracefulExit API somewhere in the docs.

Daste745 avatar Oct 27 '22 21:10 Daste745

I added it under the same section that AppRunner and ServerRunner live. I'm not sure if it's the best spot though.

Daste745 avatar Oct 28 '22 22:10 Daste745