{"record":{"id":"e94d6838b11a04fa","repo":"astral-sh/ruff","slug":"received-exit-notification-before-a-shutdown-reque","errorCode":null,"errorMessage":"Received exit notification before a shutdown request","messagePattern":"Received exit notification before a shutdown request","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/ruff_server/src/server/main_loop.rs","lineNumber":66,"sourceCode":"                                    \"Received request after server shutdown was requested, discarding\"\n                                );\n                                client.respond_err(\n                                    req.id,\n                                    lsp_server::ResponseError {\n                                        code: lsp_server::ErrorCode::InvalidRequest as i32,\n                                        message: \"Shutdown already requested\".to_owned(),\n                                        data: None,\n                                    },\n                                )?;\n                                continue;\n                            }\n\n                            api::request(req)\n                        }\n                        Message::Notification(notification) => {\n                            if notification.method == lsp_types::ExitNotification::METHOD.as_str() {\n                                if !self.session.is_shutdown_requested() {\n                                    return Err(anyhow!(\n                                        \"Received exit notification before a shutdown request\"\n                                    ));\n                                }\n\n                                tracing::debug!(\"Received exit notification, exiting\");\n                                return Ok(());\n                            }\n\n                            api::notification(notification)\n                        }\n\n                        // Handle the response from the client to a server request\n                        Message::Response(response) => {\n                            if let Some(handler) = self\n                                .session\n                                .request_queue_mut()\n                                .outgoing_mut()\n                                .complete(&response.id)","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/astral-sh/ruff/blob/672bb4edf04c84f8b0753346359daee4057158f2/crates/ruff_server/src/server/main_loop.rs#L48-L84","documentation":"Error \"Received exit notification before a shutdown request\" thrown in astral-sh/ruff.","triggerScenarios":"Thrown at crates/ruff_server/src/server/main_loop.rs:66 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"672bb4edf04c84f8b0753346359daee4057158f2","analyzedAt":"2026-08-16T08:54:05.464Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}