fix: tolerate QMP socket removal during status probes

This commit is contained in:
Codex
2026-10-13 04:11:42 +03:00
parent d7d01a4520
commit a6367e55ae
2 changed files with 17 additions and 2 deletions
+4 -2
View File
@@ -182,9 +182,11 @@ class Runtime:
raise RuntimeError(f'Cannot verify VM identity: {exc}') from exc
def _listening(self, path: Path) -> bool:
if not path.exists():
try:
mode = path.lstat().st_mode
except FileNotFoundError:
return False
if not stat.S_ISSOCK(path.lstat().st_mode):
if not stat.S_ISSOCK(mode):
raise RuntimeError(f'Refusing non-socket runtime path: {path}')
with socket.socket(socket.AF_UNIX) as probe:
probe.settimeout(min(1, self.boot_timeout))