From c657e26d3677836782e62712d9eaef516e615d57 Mon Sep 17 00:00:00 2001 From: arimu1 <19286898+arimu1@users.noreply.github.com> Date: Sat, 1 Aug 2026 17:09:18 +0700 Subject: [PATCH] Change default SolidLSP request timeout to 300s SolidLanguageServer.create previously defaulted timeout=None, so Request waits were unbounded. Test construction never set a timeout; a wedged language server (intermittent ccls hang during indexing) could stall CI until the job cap. Default create to DEFAULT_LS_REQUEST_TIMEOUT (300s). Explicit timeout=None still opts out. Project continues to pass ls_timeout from tool_timeout. Resolves #1717 Co-authored-by: Dominik Jain --- src/solidlsp/ls.py | 6 +++--- src/solidlsp/ls_process.py | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/solidlsp/ls.py b/src/solidlsp/ls.py index 990b1422..d0706a72 100644 --- a/src/solidlsp/ls.py +++ b/src/solidlsp/ls.py @@ -33,7 +33,7 @@ from solidlsp.dependency_provider import ( from solidlsp.initialize_params import DefaultInitializeParamsBuilder, InitializeParamsBuilder from solidlsp.ls_config import FilenameMatcher, LanguageServerConfig, LanguageServerId from solidlsp.ls_exceptions import InvalidTextLocationError, SolidLSPException -from solidlsp.ls_process import LanguageServerInterface, StdioLanguageServer +from solidlsp.ls_process import DEFAULT_LS_REQUEST_TIMEOUT, LanguageServerInterface, StdioLanguageServer from solidlsp.ls_types import UnifiedSymbolInformation from solidlsp.ls_utils import FileUtils, PathUtils, TextUtils from solidlsp.lsp_protocol_handler import lsp_types @@ -451,7 +451,7 @@ class SolidLanguageServer(ABC): cls, config: LanguageServerConfig, repository_root_path: str, - timeout: float | None = None, + timeout: float | None = DEFAULT_LS_REQUEST_TIMEOUT, solidlsp_settings: SolidLSPSettings | None = None, ) -> "SolidLanguageServer": """ @@ -463,7 +463,7 @@ class SolidLanguageServer(ABC): :param repository_root_path: The root path of the repository. :param config: language server configuration. :param logger: The logger to use. - :param timeout: the timeout for requests to the language server. If None, no timeout will be used. + :param timeout: the timeout, in seconds, for requests to the language server; if None, use no timeout :param solidlsp_settings: additional settings :return LanguageServer: A language specific LanguageServer instance. """ diff --git a/src/solidlsp/ls_process.py b/src/solidlsp/ls_process.py index 3acec5a5..c4c1d9e7 100644 --- a/src/solidlsp/ls_process.py +++ b/src/solidlsp/ls_process.py @@ -35,6 +35,12 @@ from solidlsp.util import subprocess_util log = logging.getLogger(__name__) + +DEFAULT_LS_REQUEST_TIMEOUT: float = 300.0 +""" +Default request timeout, in seconds, when callers do not pass an explicit timeout +""" + # Per the LSP spec, `ContentModified` (-32801) means the server discarded a stale, in-flight # computation because the workspace changed underneath it, not that the request itself is # invalid. A well-behaved client is expected to retry such requests -- but only requests it has