Compare commits

...

1 Commits

Author SHA1 Message Date
Alex Cheema
df1335955b Try multiple endpoints for internet connectivity check
Some ISPs/networks block connections to 1.1.1.1, causing exo to
incorrectly report no internet connectivity and fail to download
models. Try 1.1.1.1, 8.8.8.8, and 1.0.0.1 in sequence, succeeding
if any responds.

Fixes #1425

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 10:28:12 -08:00

View File

@@ -116,14 +116,17 @@ class DownloadCoordinator:
tg.start_soon(self._check_internet_connection)
def _test_internet_connection(self) -> None:
try:
socket.create_connection(("1.1.1.1", 443), timeout=3).close()
self.shard_downloader.set_internet_connection(True)
except OSError:
self.shard_downloader.set_internet_connection(False)
logger.debug(
f"Internet connectivity: {self.shard_downloader.internet_connection}"
)
# Try multiple endpoints since some ISPs/networks block specific IPs
for host in ("1.1.1.1", "8.8.8.8", "1.0.0.1"):
try:
socket.create_connection((host, 443), timeout=3).close()
self.shard_downloader.set_internet_connection(True)
logger.debug(f"Internet connectivity: True (via {host})")
return
except OSError:
continue
self.shard_downloader.set_internet_connection(False)
logger.debug("Internet connectivity: False")
async def _check_internet_connection(self) -> None:
first_connection = True