{"record":{"id":"0b9bb5583d3cdbe4","repo":"oraios/serena","slug":"request-timed-out-timeout","errorCode":null,"errorMessage":"Request timed out ({timeout=})","messagePattern":"Request timed out \\((.+?)\\)","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/ls_process.py","lineNumber":107,"sourceCode":"    def on_result(self, params: PayloadLike) -> None:\n        self._status = \"completed\"\n        self._result_queue.put(Request.Result(payload=params))\n\n    def on_error(self, err: Exception) -> None:\n        \"\"\"\n        :param err: the error that occurred while processing the request (typically an LSPError\n            for errors returned by the LS or LanguageServerTerminatedException if the error\n            is due to the language server process terminating unexpectedly).\n        \"\"\"\n        self._status = \"error\"\n        self._result_queue.put(Request.Result(error=err))\n\n    def get_result(self, timeout: float | None = None) -> Result:\n        try:\n            return self._result_queue.get(timeout=timeout)\n        except Empty as e:\n            if timeout is not None:\n                raise TimeoutError(f\"Request timed out ({timeout=})\") from e\n            raise e\n\n\nclass LanguageServerInterface(ABC):\n    \"\"\"\n    Represents an interface to a language server, providing methods for communicating with it using the\n    Language Server Protocol (LSP).\n\n    It provides methods for sending requests, responses, and notifications to the server\n    and for registering handlers for requests and notifications from the server.\n\n    Uses JSON-RPC 2.0 for communication with the server over stdin/stdout.\n    \"\"\"\n\n    def __init__(\n        self,\n        ls_id: LanguageServerId,\n        determine_log_level: Callable[[str], int],","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/ls_process.py#L89-L125","documentation":"TimeoutError raised by LSPProcess.get_result when the result queue yields nothing within the given timeout. _send_request_once sends a request to the language-server subprocess and waits on a multiprocessing queue; if the server process never responds in time, the Empty queue exception is converted into this TimeoutError with the timeout value embedded.","triggerScenarios":"Calling any request API with a timeout shorter than the server's response time (huge files, cold-start indexing), a hung/crashed LSP subprocess, or requests sent to a server busy with a long operation (e.g. initial project indexing).","commonSituations":"Large monorepos where the first request times out during startup indexing, language-server binary hanging (known issues with some LSPs on big files), system resource starvation slowing the subprocess, or a dead subprocess after a crash so no result ever arrives.","solutions":["Retry with a larger timeout (or None) for slow servers / first-request indexing.","Check whether the LSP subprocess is alive; if it crashed or hung, restart the SolidLanguageServer instance.","Reduce workload: request symbols for smaller scopes/files, or warm up the server with a cheap request before time-sensitive calls.","Capture the language server's stderr/log output to identify a hang or crash in the underlying LSP binary."],"exampleFix":"// before\nresult = ls.request_document_symbols(\"huge/generated.ts\", timeout=1.0)\n// after\ntry:\n    result = ls.request_document_symbols(\"huge/generated.ts\", timeout=1.0)\nexcept TimeoutError:\n    result = ls.request_document_symbols(\"huge/generated.ts\", timeout=60.0)","handlingStrategy":"retry","validationCode":"import psutil\nproc = getattr(ls, \"_lsp_process\", None)\nif proc is not None and not proc.is_alive():\n    raise RuntimeError(\"LSP subprocess dead; restart the server before issuing requests\")","typeGuard":null,"tryCatchPattern":"try:\n    result = call_api(..., timeout=timeout_s)\nexcept TimeoutError:\n    result = call_api(..., timeout=timeout_s * 4)  # retry with backoff and larger timeout","preventionTips":["Use generous timeouts (or none) for first requests on large projects","Warm up the server with a small request after startup","Monitor LSP subprocess liveness and stderr for hangs/crashes","Restart the SolidLanguageServer instance after a timeout instead of reusing a possibly wedged process"],"tags":["timeout","lsp","process","ipc"],"backgroundTag":"request-timeout","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}