GlobalRouter.__init__ always constructs both httpx.Client and httpx.AsyncClient, but close() only closes the sync client and aclose() only closes the async client. As a result, with GlobalRouter(...) leaves the async client open, while async with GlobalRouter(...) leaves the sync client open. This can leak connection pools and produce unclosed-client warnings. Close both clients from both shutdown paths, using the appropriate sync/async close operation or lazy creation.
File: src/globalrouter/_client.py
Line: 77
Severity: medium
Summary: close methods leak opposite httpx client
GlobalRouter.__init__always constructs bothhttpx.Clientandhttpx.AsyncClient, butclose()only closes the sync client andaclose()only closes the async client. As a result,with GlobalRouter(...)leaves the async client open, whileasync with GlobalRouter(...)leaves the sync client open. This can leak connection pools and produce unclosed-client warnings. Close both clients from both shutdown paths, using the appropriate sync/async close operation or lazy creation.File:
src/globalrouter/_client.pyLine: 77
Severity: medium
Summary: close methods leak opposite httpx client