Skip to content

Commit

Permalink
add some debug logging to see how effective this is
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Oct 31, 2024
1 parent 61edb09 commit 31b9637
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions aiohttp/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@
SSLContext = object # type: ignore[misc,assignment]


import logging

LOGGER = logging.getLogger(__name__)

EMPTY_SCHEMA_SET = frozenset({""})
HTTP_SCHEMA_SET = frozenset({"http", "https"})
WS_SCHEMA_SET = frozenset({"ws", "wss"})
Expand Down Expand Up @@ -521,8 +525,10 @@ async def connect(
# we can avoid the timeout ceil logic and directly return the connection
if traces:
await self._send_connect_reuseconn(key, traces)
LOGGER.warning("Avoid timeout HIT %s", key)
return self._acquired_connection(proto, key)

LOGGER.warning("Avoid timeout MISS %s", key)
async with ceil_timeout(
timeout.connect,
ceil_threshold=timeout.ceil_threshold,
Expand Down

0 comments on commit 31b9637

Please sign in to comment.