{"record":{"id":"d80b0da4011a13dd","repo":"quickwit-oss/quickwit","slug":"node-not-found-in-pending","errorCode":null,"errorMessage":"node not found in pending","messagePattern":"node not found in pending","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"quickwit/quickwit-dst/src/models/parquet_data_model.rs","lineNumber":97,"sourceCode":"\nimpl DataModelState {\n    fn pending_for(&self, node: Node) -> &BTreeSet<DataPoint> {\n        for (n, set) in &self.pending {\n            if *n == node {\n                return set;\n            }\n        }\n        // Should not happen in well-formed model.\n        panic!(\"node not found in pending\");\n    }\n\n    fn pending_for_mut(&mut self, node: Node) -> &mut BTreeSet<DataPoint> {\n        for (n, set) in &mut self.pending {\n            if *n == node {\n                return set;\n            }\n        }\n        panic!(\"node not found in pending\");\n    }\n\n    fn all_stored_rows(&self) -> BTreeSet<DataPoint> {\n        self.splits\n            .iter()\n            .flat_map(|s| s.rows.iter().cloned())\n            .collect()\n    }\n\n    fn all_pending_rows(&self) -> BTreeSet<DataPoint> {\n        self.pending\n            .iter()\n            .flat_map(|(_, set)| set.iter().cloned())\n            .collect()\n    }\n}\n\n/// Actions.","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-dst/src/models/parquet_data_model.rs#L79-L115","documentation":"serve_quickwit spawns the REST server as a named Tokio task and awaits its JoinHandle. The `.expect` fires when the JoinHandle returns Err, meaning the task panicked or was cancelled before completing. The library treats a dead REST server task as an unrecoverable condition, so it panics rather than silently continuing without the REST API.","triggerScenarios":"The `rest_server` future panics while handling a request (e.g. a bug in a handler, or a dependent component such as the metastore or cluster actor panics); or the spawned task is cancelled/aborted and the JoinHandle yields a JoinError.","commonSituations":"A panic in a request handler or actor the REST server awaits during startup; tokio runtime shutdown while the server task is still running; memory exhaustion or an OOM kill triggered inside the task; running with a config that makes an internally awaited subsystem panic at boot.","solutions":["Inspect logs immediately before the panic message to find the underlying panic (via the panic hook/backtrace) and fix the root cause in the handler or subsystem.","Run with RUST_BACKTRACE=1 to capture a full backtrace identifying which handler or task panicked.","Check resource limits (memory, file descriptors) on the host; panics under OOM pressure are common in long-running servers.","Validate the Quickwit config with `quickwit config check` so components do not panic during startup inside the REST server task."],"exampleFix":"// before: panic on join error\n.expect(\"tasks running the REST server should not panic or be cancelled\")\n// after: report and propagate the failure\nlet rest_result = spawn_named_task(rest_server, \"rest_server\").await;\nlet rest = rest_result\n    .map_err(|err| anyhow::anyhow!(\"REST server task failed: {err}\"))\n    .and_then(|res| res.context(\"REST server failed\"));","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// wrap the serve result\nmatch serve_quickwit(config).await {\n    Err(err) if err.to_string().contains(\"REST server\") => {\n        eprintln!(\"REST server task died: {err:#}\");\n        // inspect logs for the original panic before this message\n    }\n    other => other?,\n}","preventionTips":["Run production nodes with RUST_BACKTRACE=1 so panics are diagnosable.","Validate config with `quickwit config check` before starting the node.","Monitor memory/fd limits to avoid OOM-induced task panics.","Keep the node under a supervisor (systemd/k8s) that restarts on exit."],"tags":["rust","tokio","panic","rest-server","internal-invariant"],"backgroundTag":"internal-invariant-violation","analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}