{"record":{"id":"872cb4a9119d273a","repo":"BloopAI/vibe-kanban","slug":"failed-to-cleanly-kill-running-execution-processes","errorCode":null,"errorMessage":"Failed to cleanly kill running execution processes","messagePattern":"Failed to cleanly kill running execution processes","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/server/src/main.rs","lineNumber":241,"sourceCode":"        tokio::select! {\n            _ = ctrl_c => {},\n            _ = terminate => {},\n        }\n    }\n\n    #[cfg(not(unix))]\n    {\n        // Only ctrl_c is available, so just await it\n        ctrl_c.await;\n    }\n}\n\npub async fn perform_cleanup_actions(deployment: &DeploymentImpl) {\n    deployment\n        .container()\n        .kill_all_running_processes()\n        .await\n        .expect(\"Failed to cleanly kill running execution processes\");\n}\n","sourceCodeStart":223,"sourceCodeEnd":243,"githubUrl":"https://github.com/BloopAI/vibe-kanban/blob/4deb7eca8f381f7cbc1f9d15515a9ab8f8009053/crates/server/src/main.rs#L223-L243","documentation":"perform_cleanup_actions asks the deployment container to kill all running execution processes. If kill_all_running_processes() returns Err (a process could not be terminated, the container runtime is unresponsive, or the internal command channel failed), the .expect panics with this message during cleanup.","triggerScenarios":"One or more executor processes ignore termination signals or are in uninterruptible (D) state; the container runtime daemon is stopped or wedged; the async kill fails on the container's command channel (closed pipe, dead runtime); process handles were already reaped/invalidated.","commonSituations":"Ctrl-C shutdown while an exec task hangs; Docker/containerd daemon restart mid-session; unkillable child processes blocked on dead I/O after an OOM; Windows kill-semantics differences.","solutions":["Identify which process failed to die (process list / container logs) and kill it manually (kill -9, docker kill).","Restart the container runtime if the daemon is unresponsive, then retry shutdown.","Check for D-state processes blocked on I/O — they cannot die until the underlying I/O resolves.","Treat cleanup failures as non-fatal: log instead of expect, so remaining cleanup steps still run.","Ensure executors handle termination signals and exit cleanly on the first kill attempt."],"exampleFix":"// before\ndeployment.container().kill_all_running_processes().await\n    .expect(\"Failed to cleanly kill running execution processes\");\n// after\nif let Err(e) = deployment.container().kill_all_running_processes().await {\n    tracing::error!(\"Failed to cleanly kill running execution processes: {e}\");\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match deployment.container().kill_all_running_processes().await {\n    Ok(()) => tracing::info!(\"all execution processes killed\"),\n    Err(e) => tracing::error!(\"cleanup: failed to kill running processes: {e}\")\n}","preventionTips":["Never .expect()/panic inside shutdown/cleanup paths; log and continue so remaining cleanup runs.","Ensure executor processes install signal handlers and exit promptly on termination signals.","Monitor for hung/zombie child processes and enforce kill timeouts with SIGKILL escalation.","Keep the container runtime healthy and verify daemon availability before teardown.","Avoid shutting down while long uninterruptible I/O operations are in flight."],"tags":["process-management","shutdown","container","cleanup"],"backgroundTag":"process-kill-failed","analyzedSha":"4deb7eca8f381f7cbc1f9d15515a9ab8f8009053","analyzedAt":"2026-08-29T09:24:13.446Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}