{"record":{"id":"6e1152b1f1aa493e","repo":"rust-lang/rust-analyzer","slug":"a-receiver-has-been-dropped-something-panicked","errorCode":null,"errorMessage":"A receiver has been dropped, something panicked!","messagePattern":"A receiver has been dropped, something panicked!","errorType":"error_code","errorClass":"anyhow::Error","httpStatus":null,"severity":"critical","filePath":"crates/rust-analyzer/src/main_loop.rs","lineNumber":217,"sourceCode":"                self.fetch_workspaces(cause, path, force_crate_graph_reload);\n            }\n        }\n\n        while let Ok(event) = self.next_event(&inbox) {\n            let Some(event) = event else {\n                anyhow::bail!(\"client exited without proper shutdown sequence\");\n            };\n            if matches!(\n                &event,\n                Event::Lsp(lsp_server::Message::Notification(Notification { method, .. }))\n                if method == lsp_types::ExitNotification::METHOD.as_str()\n            ) {\n                return Ok(());\n            }\n            self.handle_event(event);\n        }\n\n        Err(anyhow::anyhow!(\"A receiver has been dropped, something panicked!\"))\n    }\n\n    fn register_did_save_capability(&mut self, additional_patterns: impl Iterator<Item = String>) {\n        let additional_filters = additional_patterns.map(|pattern| {\n            lsp_types::DocumentFilter::TextDocumentFilter(lsp_types::TextDocumentFilter::Pattern(\n                lsp_types::TextDocumentFilterPattern {\n                    language: None,\n                    scheme: None,\n                    pattern: pattern.into(),\n                },\n            ))\n        });\n\n        let mut selectors = vec![\n            lsp_types::DocumentFilter::TextDocumentFilter(lsp_types::TextDocumentFilter::Pattern(\n                lsp_types::TextDocumentFilterPattern {\n                    language: None,\n                    scheme: None,","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/rust-lang/rust-analyzer/blob/e8f7e90aa3e7b26aa9a000200f606c1078da99ec/crates/rust-analyzer/src/main_loop.rs#L199-L235","documentation":"The main loop's `run` drives the event loop until either the connection closes (returns `Ok(())`) or, upon exiting the loop for any other reason, returns `Err(\"A receiver has been dropped, something panicked!\")`. This signals that a task/thread owned by the server (e.g. a task pool worker or queue task holding the other end of the crossbeam channel) panicked or was dropped, so the event loop can no longer make progress.","triggerScenarios":"An internal task panicking (e.g. a `thread::spawn`ed task or a pool task handling a request dies), causing the sender side of the main-loop event channel to drop and the loop's recv/dispatch path to terminate abnormally rather than with a clean shutdown notification.","commonSituations":"Bug-triggered panics inside task handlers while processing a particular request; OOM or panics in workspace loading threads; running a broken/nightly-only server binary against unexpected inputs.","solutions":["Check rust-analyzer's logs (RA_LOG / editor output channel) for the panic message and backtrace to find the offending task.","Update rust-analyzer to the latest release; many task panics are fixed bugs.","Reduce the trigger: identify which request/file caused the panic and minimize or avoid it, then file an issue.","Restart the language server; the panic is terminal for this server instance.","As a last resort, clear target/ caches (`cargo clean`, delete `target/`) if the panic stems from corrupted cached state."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match rust_analyzer::run(server) {\n    Ok(()) => {}\n    Err(e) if e.to_string().contains(\"receiver has been dropped\") => {\n        // a worker task panicked; log the captured panic, then restart the server process\n        tracing::error!(\"internal task panicked: {e:#}\"),\n        restart_server_with_backoff();\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Keep rust-analyzer updated; task panics are fixed continuously.","Run with RA_LOG env tracing enabled so the panicking task is identifiable.","Avoid unrelease-toolchain mismatches that can panic workspace-loading tasks.","Supervise the LSP process (editor restart-on-crash settings) so a panic doesn't kill the whole session."],"tags":["panic","channel","lsp-server","rust-analyzer"],"backgroundTag":"channel-closed-panic","analyzedSha":"e8f7e90aa3e7b26aa9a000200f606c1078da99ec","analyzedAt":"2026-09-03T21:08:06.959Z","contentChangedAt":"2026-09-03T21:08:06.959Z","schemaVersion":2},"datasetVersion":"2026-09-11T07:07:21.782Z"}