{"record":{"id":"0e5d6c53a76a9e7d","repo":"windmill-labs/windmill","slug":"isolate-failed-during-pre-warm","errorCode":null,"errorMessage":"isolate failed during pre-warm","messagePattern":"isolate failed during pre-warm","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/windmill-runtime-nativets/src/dedicated.rs","lineNumber":140,"sourceCode":"                let logs = log_handle.await.unwrap_or_default();\n                let _ = result_tx.send(PrewarmedResult { result, logs });\n                Ok(())\n            })\n        });\n\n        PrewarmedIsolate {\n            args_tx: Some(args_tx),\n            result_rx: Some(result_rx),\n            ready_rx: Some(ready_rx),\n            handle: Some(handle),\n        }\n    }\n\n    /// Wait for the isolate to finish loading modules.\n    pub async fn wait_ready(&mut self) -> anyhow::Result<()> {\n        if let Some(rx) = self.ready_rx.take() {\n            rx.await\n                .map_err(|_| anyhow::anyhow!(\"isolate failed during pre-warm\"))?;\n        }\n        Ok(())\n    }\n\n    /// Send args and start execution. Returns an `ExecutingIsolate` that\n    /// can be awaited independently, allowing the caller to pre-warm\n    /// the next isolate in parallel.\n    pub fn start_execution(mut self, args: String) -> ExecutingIsolate {\n        let args_tx = self.args_tx.take().expect(\"start_execution called twice\");\n        let _ = args_tx.send(args);\n        ExecutingIsolate {\n            result_rx: self.result_rx.take().expect(\"result_rx missing\"),\n            handle: self.handle.take().expect(\"handle missing\"),\n        }\n    }\n}\n","sourceCodeStart":122,"sourceCodeEnd":157,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/windmill-runtime-nativets/src/dedicated.rs#L122-L157","documentation":"PrewarmedIsolate::wait_ready awaits a oneshot channel that the isolate signals once module pre-loading finishes. If the sender is dropped before signaling success — the isolate failed during pre-warm — this error is thrown.","triggerScenarios":"Calling wait_ready() on a PrewarmedIsolate whose ready_tx was dropped without Ok: module load failed inside the isolate and the isolate task exited, or the isolate thread died during warm-up.","commonSituations":"Scripts importing modules that fail to resolve/compile at warm-up time; network failures fetching remote npm/URL imports during pre-warm; isolate killed during initialization.","solutions":["Check logs for the underlying module-load failure reported by the isolate before the channel closed","Verify network access from the worker to remote module registries (npm, https imports)","Retry the execution to rule out a transient warm-up failure","Pin/verify imported module versions so warm-up is deterministic","Upgrade the runtime if module-load failures panic instead of reporting a clean error"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// validate warm-up deterministically before relying on pre-warm\nasync fn prewarm_safe(make: impl Fn() -> PrewarmedIsolate) -> anyhow::Result<PrewarmedIsolate> {\n    let mut iso = make();\n    if let Err(e) = iso.wait_ready().await {\n        tracing::warn!(\"pre-warm failed ({e}); falling back to cold start\");\n        return Err(e);\n    }\n    Ok(iso)\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = isolate.wait_ready().await {\n    // fall back to a cold (non-prewarmed) execution path\n    return run_cold(args).await;\n}","preventionTips":["Pin all imported module versions (npm/URL imports) so warm-up is deterministic","Ensure the worker has network access to module registries before enabling pre-warm","Fall back to cold execution when wait_ready fails instead of failing the job","Test that imports resolve in the exact worker image you deploy"],"tags":["deno","isolate","prewarm","module-loading"],"backgroundTag":"isolate-prewarm-failure","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"}