From 2b6501d8e5a751a17940aed32f77040b5a000764 Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Sun, 23 Aug 2026 11:35:41 -0700 Subject: [PATCH] Give the exit-status poll room now that it fails closed `wait_for_exec_exit` returning `None` used to mean "call it 0"; it now fails the call, so a busy daemon that has not settled within ~1s would turn into a spurious "the rename failed". The loop exits on the first poll that reports finished, so a wider window costs nothing when things are normal. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01GBq2rGum6GX7xXgsas1fDc --- app/src-tauri/src/docker/exec.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src-tauri/src/docker/exec.rs b/app/src-tauri/src/docker/exec.rs index 530e7b5..00699a6 100644 --- a/app/src-tauri/src/docker/exec.rs +++ b/app/src-tauri/src/docker/exec.rs @@ -636,11 +636,17 @@ fn require_exit_code(code: Option) -> Result { /// Poll `inspect_exec` until the exec reports finished and return its exit code. /// Returns `None` if the code can't be determined (inspect error, or the exec -/// doesn't report finished within ~1s — which shouldn't happen once its output +/// doesn't report finished within ~5s — which shouldn't happen once its output /// stream has drained). +/// +/// The window is generous because `None` is no longer a shrug: since +/// [`require_exit_code`], it fails the whole call. Waiting a few seconds longer +/// for a busy daemon to settle costs nothing in the normal case — the loop exits +/// on the first poll that reports finished — and it is the difference between a +/// spurious "the rename failed" and a real one. pub async fn wait_for_exec_exit(exec_id: &str) -> Option { let docker = get_docker().ok()?; - for _ in 0..40 { + for _ in 0..200 { match docker.inspect_exec(exec_id).await { Ok(info) => { if info.running != Some(true) {