Document the need to catch GracefulExit
if handle_signals=True
#4414
Labels
documentation
Improvements or additions to documentation
enhancement
good first issue
Good for newcomers
Hacktoberfest
We think it's good for https://hacktoberfest.digitalocean.com/
server
Long story short
I've been using low-level machinery exposed by aiohttp for my framework.
When I learned about
handle_signals=True
I started testing it and it turned out that my process always exited with return code 1 onSIGTERM
andSIGINT
.This was confusing and I thought that it's a bug. But then, after diving into the code deeper, I realized that with this option enabled, aiohttp binds the corresponding handler to process these signals and the only thing they do is raising
GracefulExit
(which is a subclass ofSystemExit
with the return code defaulting to 1).Turns out that it works but only if one uses
aiohttp.web.run_app()
. This was the last bit of the puzzle for me: using low-level APIs implies that I mostly don't rely on high-level interfaces and thus have to catch theGracefulExit
exception in my own runner code.So my request here is that this should be documented.
I'm marking this as a "good first issue" so that new contributors could have something easy to start with.
Expected behaviour
Docs clarifying this.
Actual behaviour
Docs don't mention this detail.
Steps to reproduce
N/A
Your environment
N/A
The text was updated successfully, but these errors were encountered: