Skip to content

Commit

Permalink
Log suppressed exceptions in GunicornWebWorker (fixes aio-libs#3464)
Browse files Browse the repository at this point in the history
  • Loading branch information
ods committed Dec 25, 2018
1 parent 8c45b4e commit 94cdc96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/3464.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Log suppressed exceptions in ``GunicornWebWorker``.
5 changes: 3 additions & 2 deletions aiohttp/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import re
import signal
import sys
from contextlib import suppress
from types import FrameType
from typing import Any, Optional # noqa

Expand Down Expand Up @@ -68,8 +67,10 @@ def run(self) -> None:
self.loop.run_until_complete(self._runner.setup())
self._task = self.loop.create_task(self._run())

with suppress(Exception): # ignore all finalization problems
try: # ignore all finalization problems
self.loop.run_until_complete(self._task)
except Exception as error:
self.log.exception(error)
if sys.version_info >= (3, 6):
if hasattr(self.loop, 'shutdown_asyncgens'):
self.loop.run_until_complete(self.loop.shutdown_asyncgens())
Expand Down

0 comments on commit 94cdc96

Please sign in to comment.