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 <dominik.jain@oraios-ai.de>
This commit is contained in:
arimu1andDominik Jain authored and Dr. Dominik Jain committed 2026-08-05 13:48:34 +02:00
1 parent df5ab4f607
commit c657e26d36
2 files changed
+9 -3

No files matched your search

+3 -3
View File
@@ -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.
"""
+6
View File
@@ -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