Not the same as SLI-1229 or SLI-2080: the server is reachable and sync works for the first ~15 minutes.
Please provide
- Operating system: Windows 11 Pro (10.0.26200)
- SonarQube for IntelliJ plugin version: 12.9.0.85269 (bundled sloop / sonarlint-core 11.10.0.86299, httpclient5 5.6.4)
- IntelliJ version: JetBrains Rider 2026.2 (IntelliJ Platform)
- Programming language you’re coding in: C# (also TypeScript/JavaScript)
- Is connected mode used: Yes
- SonarQube Cloud, SonarQube Server, or SonarQube Community Build? (if one of the latter two, which version?): SonarQube Community Build 25.8.0.112029, behind an Apache reverse proxy with mod_deflate enabled
And a thorough description of the problem / question:
Symptom After about 15 minutes, “SonarQube: Synchronizing projects…” never finishes. In thread dumps, SonarLint Local Storage Synchronizer, Smart Notifications Polling and Show Issue or Hotspot Request Handler are all blocked in ServerApiHelper.processResponse → CompletableFuture.join for hours. Only a backend restart recovers it.
Root cause
ApacheHttpClientAdapter.getEventStreamsets a per-request config built withRequestConfig.custom(). That replaces the default config fromHttpClientProvider.buildRequestConfig, which hassetContentCompressionEnabled(false). A freshRequestConfig.Builderdefaults compression totrue, so the SSE request is sent withAccept-Encoding: gzip, deflate.- The proxy gzip-compresses the
text/event-streamresponse and buffers it, so the\r\nheartbeats never reach the client. Tested with curl againstapi/push/sonarlint_events:- without
Accept-Encoding: a heartbeat arrives about every 20 s; - with
Accept-Encoding: gzip: 0 bytes in 200 s.
- without
EventStreamarms a 180 s watchdog inonConnected(), and only received data cancels it. When it fires, it callsconnect(wsPath), which overwritescurrentRequestwithout cancelling the previous request.- The SSE request uses
setResponseTimeout(Timeout.ZERO_MILLISECONDS), so the abandoned exchange keeps its pooled connection forever. - One connection leaks every 180 s. After 5 (the default max per route) the pool is exhausted, and every other request waits for a lease indefinitely. httpcore5’s
StrictConnPoolonly checks lease deadlines when the pool sees activity, soconnectionRequestTimeout, and the-Dsonarlint.http.*properties, don’t unblock it.
Heap histogram of the hung backend: 6 live ApacheHttpClientAdapter$1 (SSE consumers) but only 1 HttpAsyncRequest, 5 PoolEntry, and 4 pending StrictConnPool$LeaseRequest.
Suggested fixes (any one solves it; 1 and 2 together are best)
- In
getEventStream, call.setContentCompressionEnabled(false)on the per-request config, or derive it from the default config instead ofRequestConfig.custom(). Compression is never wanted for SSE. - In
EventStream, cancel or close the current request before reconnecting from the watchdog:Optional.ofNullable(currentRequest.getAndSet(null)).ifPresent(AsyncRequest::cancel)at the start ofconnect(...). - Optionally, give the SSE request a finite socket/response timeout longer than the heartbeat period (for example 2–3 minutes) instead of
ZERO.
Workaround verified Patching getEventStream to add setContentCompressionEnabled(false) in sonarlint-http-11.10.0.86299.jar fixed it: the backend holds 1–2 connections and sync completes. (stable for 41 minutes)