From fe13c61b91365e07785cb314374e8e502a4f8e0a Mon Sep 17 00:00:00 2001 From: Aviad Shiber Date: Sat, 11 Apr 2026 19:55:30 +0300 Subject: [PATCH] fix: restore 120s timeout for jdtls initialize (Maven classpath resolution) Even module-scoped jdtls init can take >30s when the module has many Maven dependencies that need classpath resolution on first cold start. The 30s REQUEST_TIMEOUT was sufficient for simple workspaces but not for production modules with heavy dependency trees. _INITIALIZE_TIMEOUT = 120s applies only to the initialize handshake. Normal request timeout stays at 30s. Co-Authored-By: Claude Opus 4.6 (1M context) --- pyproject.toml | 2 +- src/java_functional_lsp/__init__.py | 2 +- src/java_functional_lsp/proxy.py | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 270de4d..2f4b0a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "java-functional-lsp" -version = "0.7.4" +version = "0.7.5" description = "Java LSP server enforcing functional programming best practices — null safety, immutability, no exceptions" readme = "README.md" license = { text = "MIT" } diff --git a/src/java_functional_lsp/__init__.py b/src/java_functional_lsp/__init__.py index f1a7966..4795437 100644 --- a/src/java_functional_lsp/__init__.py +++ b/src/java_functional_lsp/__init__.py @@ -1,3 +1,3 @@ """java-functional-lsp: A Java LSP server enforcing functional programming best practices.""" -__version__ = "0.7.4" +__version__ = "0.7.5" diff --git a/src/java_functional_lsp/proxy.py b/src/java_functional_lsp/proxy.py index a68bc47..4005a01 100644 --- a/src/java_functional_lsp/proxy.py +++ b/src/java_functional_lsp/proxy.py @@ -20,7 +20,8 @@ logger = logging.getLogger(__name__) -REQUEST_TIMEOUT = 30.0 # seconds +REQUEST_TIMEOUT = 30.0 # seconds — per-request timeout for normal operations +_INITIALIZE_TIMEOUT = 120.0 # seconds — module-scoped init can still be slow (Maven classpath resolution) DEFAULT_JVM_MAX_HEAP = "4g" _STDERR_LINE_MAX = 1000 @@ -544,7 +545,7 @@ async def start(self, init_params: dict[str, Any], *, module_root_uri: str | Non if self._process.stderr is not None: self._stderr_task = asyncio.create_task(self._stderr_reader(self._process.stderr)) - result = await self.send_request("initialize", effective_params) + result = await self.send_request("initialize", effective_params, timeout=_INITIALIZE_TIMEOUT) if result is None: logger.error("jdtls initialize request failed or timed out") await self.stop()