Skip to content

Commit 5c90a00

Browse files
authored
Force reload of /etc/resolv.conf on WebSession init (#6000)
1 parent 1f2bf77 commit 5c90a00

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

supervisor/coresys.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@ async def init_websession(self) -> None:
124124

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

0 commit comments

Comments
 (0)