Skip to content

Commit bee613d

Browse files
authored
Add clarification about GracefulExit when using handle_signals=True (#7043)
1 parent 194792a commit bee613d

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

CHANGES/4414.doc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Clarified that ``GracefulExit`` needs to be handled in ``AppRunner`` and ``ServerRunner`` when using ``handle_signals=True``. -- by :user:`Daste745`

docs/web_reference.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2596,7 +2596,8 @@ application on specific TCP or Unix socket, e.g.::
25962596
:param bool handle_signals: add signal handlers for
25972597
:data:`signal.SIGINT` and
25982598
:data:`signal.SIGTERM` (``False`` by
2599-
default).
2599+
default). These handlers will raise
2600+
:exc:`GracefulExit`.
26002601

26012602
:param kwargs: named parameters to pass into
26022603
web protocol.
@@ -2669,7 +2670,8 @@ application on specific TCP or Unix socket, e.g.::
26692670
:param bool handle_signals: add signal handlers for
26702671
:data:`signal.SIGINT` and
26712672
:data:`signal.SIGTERM` (``False`` by
2672-
default).
2673+
default). These handlers will raise
2674+
:exc:`GracefulExit`.
26732675

26742676
:param kwargs: named parameters to pass into
26752677
web protocol.
@@ -2800,6 +2802,16 @@ application on specific TCP or Unix socket, e.g.::
28002802

28012803
``128`` by default.
28022804

2805+
.. exception:: GracefulExit
2806+
2807+
Raised by signal handlers for :data:`signal.SIGINT` and :data:`signal.SIGTERM`
2808+
defined in :class:`AppRunner` and :class:`ServerRunner`
2809+
when ``handle_signals`` is set to ``True``.
2810+
2811+
Inherited from :exc:`SystemExit`,
2812+
which exits with error code ``1`` if not handled.
2813+
2814+
28032815
Utilities
28042816
---------
28052817

0 commit comments

Comments
 (0)