From ed95f649d777fc763a238cee9aa345bd1aa27259 Mon Sep 17 00:00:00 2001 From: Gerrod Ubben Date: Mon, 11 Nov 2024 16:25:49 -0500 Subject: [PATCH] Finish backporting aiohttp 3.10 bump Bumping this req broke Pulp, but only when using the downloader outside of a coroutine, which some plugins do (pulp_container). (from commit 3b0d218af8ddf97a1d5831dd8cab080194c0c768) (cherry picked from commit 386c0b99f2baa9f871c9d0a0be44c2be53581746) --- pulpcore/download/factory.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pulpcore/download/factory.py b/pulpcore/download/factory.py index bec8759f53..363b78e674 100644 --- a/pulpcore/download/factory.py +++ b/pulpcore/download/factory.py @@ -137,8 +137,11 @@ def _make_aiohttp_session_from_remote(self): sock_read=self._remote.sock_read_timeout, connect=self._remote.connect_timeout, ) + # TCPConnector is supposed to be instanciated in a running loop. + # I don't see why... + # https://github.com/aio-libs/aiohttp/pull/3372 return aiohttp.ClientSession( - connector=aiohttp.TCPConnector(**tcp_conn_opts), + connector=aiohttp.TCPConnector(loop=asyncio.get_event_loop(), **tcp_conn_opts), timeout=timeout, headers=headers, requote_redirect_url=False,