]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Ignore ConnectionResetError in vsock notify handler
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 6 Sep 2023 09:58:57 +0000 (11:58 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 6 Sep 2023 12:06:41 +0000 (14:06 +0200)
Let's handle this one gracefully but still debug log about it when
it happens.

mkosi/qemu.py

index b6defb77e61213439a59cb23e8bfa42db13f9356..85793306159c57a5e2cb5f65840be0c97c430ea6 100644 (file)
@@ -180,8 +180,11 @@ def vsock_notify_handler() -> Iterator[tuple[str, dict[str, str]]]:
 
                 with s:
                     data = []
-                    while (buf := await loop.sock_recv(s, 4096)):
-                        data.append(buf)
+                    try:
+                        while (buf := await loop.sock_recv(s, 4096)):
+                            data.append(buf)
+                    except ConnectionResetError:
+                        logging.debug("vsock notify listener connection reset by peer")
 
                 for msg in b"".join(data).decode().split("\n"):
                     if not msg: