SonarLint takes way too long to timeout in IntelliJ

*** Operating system: Mac OS**
*** SonarLint plugin version: 8.5.1.75093**
*** Programming language you’re coding in: Java**
*** Is connected mode used: Yes**
** * Connected to SonarQube **

And a thorough description of the problem / question:
We use a private sonarqube instance which can only be accessed via a VPN. It’s common to work off the VPN, but when doing so, sonarlint continuously loads, showing a loading bar at the bottom of intellij and reporting that a “process is running” if trying to exit the IDE.
When connected to the VPN however, the plugin works as expected.
I’m not sure if this is the correct channel to request features, but adding an adjustable loading timeout option OR functionality to try to connect ONLY if a given URL does not come back with a 403/404 would be great as the constantly loading progress bar becomes a distraction after a while.

Error produced:

Connect to https://REDACTED_URL [REDACTED_URL, sREDACTED_URL, REDACTED_URL, REDACTED_URL] failed: 1 MINUTES
org.apache.hc.client5.http.ConnectTimeoutException: Connect to REDACTED_URL [REDACTED_URL, REDACTED_URL, REDACTED_URL, REDACTED_URL] failed: 1 MINUTES
	at org.apache.hc.core5.io.SocketTimeoutExceptionFactory.create(SocketTimeoutExceptionFactory.java:50)
	at org.apache.hc.core5.reactor.InternalConnectChannel.onTimeout(InternalConnectChannel.java:93)
	at org.apache.hc.core5.reactor.InternalChannel.checkTimeout(InternalChannel.java:67)
	at org.apache.hc.core5.reactor.SingleCoreIOReactor.checkTimeout(SingleCoreIOReactor.java:241)
	at org.apache.hc.core5.reactor.SingleCoreIOReactor.validateActiveChannels(SingleCoreIOReactor.java:168)
	at org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:130)
	at org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:86)
	at org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44)
	at java.base/java.lang.Thread.run(Thread.java:833)

Hi @Glenn_McA, I apologize for the late response.

There is effectively an adjustable timeout! Since release 8.5.0, we modified how we handle our HTTP client and added new system properties available to users. This is not well documented for now, but here are some of the properties:

  • sonarlint.http.connectTimeout (default to 1 minute)
  • sonarlint.http.socketTimeout
  • sonarlint.http.connectionRequestTimeout
  • sonarlint.http.responseTimeout

Those are based on Apache HTTP Client, in your case, I would recommend changing the connectTimeout to a smaller value. The duration representation is based on ISO-8601, meaning patterns such as PT8H6M12.345S.

To set the timeout to 10 seconds, you can set the system property as follows: sonarlint.http.connectTimeout=PT10S

I hope that satisfies your request. Let me know if you have any trouble making this work, for IntelliJ here is the documentation to access JVM options on IntelliJ.