SonarQube错误:超时尝试锁定表" PROJECT_MEASURES"

时间:2016-07-28 18:34:24

标签: jenkins ant sonarqube sonar-runner sonarqube-scan

我有一组使用Ant 并行运行 的Jenkins作业,并将JUnit和静态分析结果上传到SonarQube。

我经常看到下面的错误。我看到了另一个关于here的问题。解决方案是序列化Sonar的执行。但是,这对我来说不是一个选择,因为这会大大减慢我的构建速度。

还有其他解决方案吗?

[sonar:sonar] 20:20:34.362 WARN  - SQL Error: 50200, SQLState: HYT00
[sonar:sonar] 20:20:34.363 ERROR - Timeout trying to lock table "PROJECT_MEASURES"; SQL statement:
[sonar:sonar] select snapshot1_.created_at as col_0_0_, measuremod0_.metric_id as col_1_0_, measuremod0_.value as col_2_0_ from project_measures measuremod0_, snapshots snapshot1_ where measuremod0_.snapshot_id=snapshot1_.id and snapshot1_.project_id=? and snapshot1_.status=? and snapshot1_.qualifier<>? and (measuremod0_.characteristic_id is null) and (measuremod0_.person_id is null) and (measuremod0_.rule_id is null) and (measuremod0_.rule_priority is null) and (measuremod0_.metric_id in (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?)) and snapshot1_.created_at>=? and snapshot1_.created_at<=? order by snapshot1_.created_at [50200-172]
[sonar:sonar] 20:20:34.390 DEBUG - Release semaphore on project : org.sonar.api.resources.Project@6598c5f6[id=2736,key=com.ibm.cloud.cms.halos.acp.task.manager,qualifier=TRK], with key batch-com.ibm.cloud.cms.halos.acp.task.manager

1 个答案:

答案 0 :(得分:3)

升级。

您没有指定您所使用的SonarQube版本,但是在5.6之后,扫描程序停止直接与数据库通信。所以它不再尝试更新任何表。相反,它编译分析报告,然后将其提交给服务器进行最终处理=&gt;没有更多的超时试图获得锁。