FindBugs timeout fails analysis

Hi,

The property seems to be sonar.findbugs.timeout.

But if it timeouts, the rule should be skipped instead of failling the scan.

My issue here is that I cannot run a full scan because of one rule.

Stack trace:

17:21:02.888 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Can not execute Findbugs with a timeout threshold value of 600000 milliseconds
	at org.sonar.plugins.findbugs.FindbugsExecutor.execute(FindbugsExecutor.java:186)
	at org.sonar.plugins.findbugs.FindbugsSensor.execute(FindbugsSensor.java:114)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:61)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:79)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:61)
	at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
	at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:403)
	at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:399)
	at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:396)
	at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:368)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
	at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:137)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.util.concurrent.TimeoutException
	at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:204)
	at org.sonar.plugins.findbugs.FindbugsExecutor.execute(FindbugsExecutor.java:182)
	... 32 more

Thanks,
Nicolas.

Hi Nicolas,

I’ve moved your post to a new topic, since the one you posted on was well over 2 years old. I understand it’s related, but please don’t resurrect old threads like that.

Regarding your problem, you’re getting a stacktrace from FindBugs:

That means Sonar doesn’t control the behavior. You’ll need to take this up with the FindBugs maintainers.

 
HTH,
Ann

Hi,

Increasing the timeout property sonar.findbugs.timeout to 1200000 worked for me.

Sonar doesn’t control the behavior of the implementation of the findbugs rule but it controls the behavior when receiving exceptions.
I don’t think the current behavior on timeout is the correct one, I’d expect the rule to be skipped and the scanner to continue its work.

I don’t think there is a need to take this up with the FindBugs maintainers. They have a timeout that already works.

Thanks,
Nicolas.

Hi Nicolas,

We take a fail-fast approach during analysis.

For instance, if analysis hadn’t errored-out, would you have ever discovered FindBugs wasn’t running successfully? How long would you have gone under the misapprehension that the check was running when it wasn’t?

 
Ann