{"record":{"id":"0fd27826a2f2e3eb","repo":"windmill-labs/windmill","slug":"isolate-thread-panicked-e","errorCode":null,"errorMessage":"isolate thread panicked: {e}","messagePattern":"isolate thread panicked: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/windmill-runtime-nativets/src/dedicated.rs","lineNumber":28,"sourceCode":"pub 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\n        .iter()\n        .map(|name| map.get(name).cloned())\n        .collect()","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/windmill-runtime-nativets/src/dedicated.rs#L10-L46","documentation":"After the result channel resolves, ExecutingIsolate::wait awaits the isolate thread's JoinHandle. If the thread panicked, the JoinError is wrapped into this error, indicating the dedicated Deno isolate crashed while running (or finishing) the script.","triggerScenarios":"The spawned thread running the Deno isolate panics during execution — a runtime bug in the isolate pool, memory corruption/limits, or a panic inside the module-load/execution plumbing.","commonSituations":"Heavy TS scripts exhausting isolate memory; bugs in vendored deno_core versions; native module crashes inside the isolate; workers under extreme concurrency.","solutions":["Find the original panic message/backtrace in the worker logs (it accompanies this JoinError)","Reduce script memory usage or raise the worker's memory limits","Reduce concurrent isolates to rule out resource contention","Update the backend/runtime crates; deno_core panics are fixed regularly","File a bug with the panic backtrace and the triggering script if persistent"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match exec.wait().await {\n    Err(e) if e.to_string().starts_with(\"isolate thread panicked\") => {\n        log::error!(\"isolate crashed, restarting worker pool: {e}\");\n        pool.restart().await?;\n        pool.run(args).await\n    }\n    other => other,\n}","preventionTips":["Reduce isolate concurrency to stay within worker memory","Upgrade the backend regularly — deno_core panics get patched","Capture and attach the thread panic backtrace from logs when filing issues","Stress-test heavy TS scripts before deploying them to production workers"],"tags":["deno","isolate","panic","thread"],"backgroundTag":"worker-thread-panic","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"}