Skip to content

Use the current event loop for aiohttp setup

Cal Pratt requested to merge cpratt34/fix-aiohttp-loops into master

Description

The latest version of aiohttp will make a new event loop on startup which currently does not match the loop used when creating the GRPC channel objects.

This is caused by https://github.com/aio-libs/aiohttp/pull/5572/files

For right now we can mitigate the issue by having the current event loop be forced in the aiohttp.web.Application.

Otherwise we get errors like this:

RuntimeError: Task <Task pending name='Task-5' coro=<RequestHandler._handle_request()
running at .../site-packages/aiohttp/web_protocol.py:433> cb=[Task.task_wakeup()]> got Future <Task pending name='Task-6' coro=<UnaryUnaryCall._invoke()
running at .../site-packages/grpc/aio/_call.py:509>> attached to a different loop

Merge request reports