Force reload of /etc/resolv.conf on WebSession init (#6000)

This commit is contained in:
Stefan Agner 2025-07-05 12:18:02 +02:00 committed by GitHub
parent 1f2bf77784
commit 5c90a00263
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -124,7 +124,10 @@ class CoreSys:
resolver: aiohttp.abc.AbstractResolver
try:
resolver = aiohttp.AsyncResolver(loop=self.loop)
# Use "unused" kwargs to force dedicated resolver instance. Otherwise
# aiodns won't reload /etc/resolv.conf which we need to make our connection
# check work in all cases.
resolver = aiohttp.AsyncResolver(loop=self.loop, timeout=None)
# pylint: disable=protected-access
_LOGGER.debug(
"Initializing ClientSession with AsyncResolver. Using nameservers %s",