{"record":{"id":"a8717c9a07f1a5df","repo":"windmill-labs/windmill","slug":"isolate-result-channel-closed","errorCode":null,"errorMessage":"isolate result channel closed","messagePattern":"isolate result channel closed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/windmill-runtime-nativets/src/dedicated.rs","lineNumber":25,"sourceCode":"    ExecuteError, MainArgs, NativeAnnotation,\n};\n\npub struct PrewarmedResult {\n    pub result: Result<Box<RawValue>, String>,\n    pub logs: String,\n}\n\npub struct ExecutingIsolate {\n    result_rx: tokio::sync::oneshot::Receiver<PrewarmedResult>,\n    handle: tokio::task::JoinHandle<anyhow::Result<()>>,\n}\n\nimpl ExecutingIsolate {\n    pub async fn wait(self) -> anyhow::Result<PrewarmedResult> {\n        let result = self\n            .result_rx\n            .await\n            .map_err(|_| anyhow::anyhow!(\"isolate result channel closed\"))?;\n        self.handle\n            .await\n            .map_err(|e| anyhow::anyhow!(\"isolate thread panicked: {e}\"))??;\n        Ok(result)\n    }\n}\n\npub struct PrewarmedIsolate {\n    args_tx: Option<tokio::sync::oneshot::Sender<String>>,\n    result_rx: Option<tokio::sync::oneshot::Receiver<PrewarmedResult>>,\n    ready_rx: Option<tokio::sync::oneshot::Receiver<()>>,\n    handle: Option<tokio::task::JoinHandle<anyhow::Result<()>>>,\n}\n\n/// Parse a JSON args object and reorder into positional args matching `arg_names`.\nfn args_to_positional(args_json: &str, arg_names: &[String]) -> Vec<Option<Box<RawValue>>> {\n    let map: HashMap<String, Box<RawValue>> = serde_json::from_str(args_json).unwrap_or_default();\n    arg_names","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/windmill-runtime-nativets/src/dedicated.rs#L7-L43","documentation":"ExecutingIsolate::wait awaits a oneshot channel carrying the execution result from a dedicated (pre-warmed) Deno isolate thread. If the sender is dropped without sending — the isolate side vanished before producing a result — this error is thrown.","triggerScenarios":"Calling .wait() on an ExecutingIsolate when the isolate's task dropped result_tx without sending: the isolate aborted, was dropped early, or the runtime shut the isolate down before completion.","commonSituations":"Worker shutdown or SIGKILL while a nativets script is executing; an isolate crash path that skips sending a result; bugs in the dedicated-isolate lifecycle under concurrent load.","solutions":["Check worker logs immediately before this error for isolate/runtime shutdown or panic messages","Retry the script execution; a transient isolate teardown is often one-off","Check for OOM or memory-limit kills of the worker process (isolate memory limits)","Upgrade windmill-runtime-nativets / backend to the latest version to get isolate lifecycle fixes","If reproducible, file a bug with the script and worker logs"],"exampleFix":"// caller-side hardening\nmatch isolate.wait().await {\n    Ok(result) => result,\n    Err(e) if e.to_string().contains(\"channel closed\") => {\n        // recreate a fresh prewarmed isolate and retry once\n        let mut iso = PrewarmedIsolate::new(...)?;\n        iso.wait_ready().await?;\n        iso.start(args).await?.wait().await?\n    }\n    Err(e) => return Err(e),\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match exec.wait().await {\n    Err(e) if e.to_string().contains(\"isolate result channel closed\") => {\n        // recreate isolate and retry once\n        recreate_and_run(args).await\n    }\n    other => other,\n}","preventionTips":["Gracefully drain in-flight isolates before worker restarts/shutdowns","Keep isolate memory limits generous to avoid kills mid-execution","Retry script runs at the job-queue level where possible","Watch for clusters of this error — it usually signals runtime lifecycle bugs, not bad scripts"],"tags":["deno","isolate","channel","async"],"backgroundTag":"isolate-result-channel-closed","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}