From e077ad6858e8fc644d71566065e6d6d093edde3c Mon Sep 17 00:00:00 2001 From: Else Someone Date: Tue, 24 Feb 2026 01:21:21 +0200 Subject: [PATCH] ch-runner: move wait/cleanup out of start_virtiofsd --- profiles/ch-runner.nix | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/profiles/ch-runner.nix b/profiles/ch-runner.nix index cd481fa..1b46f22 100644 --- a/profiles/ch-runner.nix +++ b/profiles/ch-runner.nix @@ -415,11 +415,11 @@ in args, **kwargs, ) + if not alive_after(proc, 0.125): + raise RuntimeError("Failed to start", args) yield proc finally: - try: - proc.wait(0.125) - except subprocess.TimeoutExpired: + if alive_after(proc, 0.125): proc.terminate() proc.wait() @@ -636,18 +636,12 @@ in # "pass_fds": (2, s.fileno()), } - with self.popen(*args, **kwargs) as p: - try: - assert alive_after(p, 0.125) - if p.returncode is not None: - raise RuntimeError("virtiofsd exited too early") + try: + with self.popen(*args, **kwargs) as p: yield p, sock_path - finally: - if p.returncode is None: - p.kill() - p.wait() - if os.path.exists(sock_path): - os.remove(sock_path) + finally: + if os.path.exists(sock_path): + os.remove(sock_path) @contextmanager