We are currently using the 7.3 version (same problem with 7.4) with MSSQL 2014.
We put in sonar.properties the following value:
sonar.ce.workerCount = 4
When we run multiple scans at the same time, we have the following error:
### Error updating database. CAUSE: com.microsoft.sqlserver.jdbc.SQLServerException: The transaction (process ID 55) has been blocked on lock resources | communication buffer by another process and was chosen as a victim. Rerun the transaction.
### The error may involve org.sonar.db.measure.LiveMeasureMapper.update-Inline
### The error occurred while setting parameters
### SQL: update live_measures set value = ?, variation =?, Text_value =?, Measure_data =?, Update_marker =?, Updated_at =? where component_uuid =? and metric_id =?
### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: The transaction (process ID 55) has been blocked on lock resources | communication buffer by another process and was chosen as a victim. Rerun the transaction.
When we change the workerCount to 1, we have no problem (but the queue grows, which causes performance issues)
Do you have any idea where the problem may come from?
Thanks in advance.
Edit :
my database is configured with “READ COMMITTED SNAPSHOT ON”
First, a reminder to any user of SonarQube: the database should be considered as a blackbox and should not be tampered with if you are willing to get any support from the dev team.
Second, for the record: while the solution described here may solve the reported issue, it is dropping a constraint which ensured consistency of data in the DB. This consistency not being enforced anymore, the impact on the application is undefined and other issues may arise.
Third, we have had reports of similar situations but we have no magic fix for it under our boot at the moment. We’ll update this thread when news comes on the subject.
Facing the same problem :
SQLServerException: Transaction (Process ID …) was deadlocked on lock resources with another process and has been chosen as the deadlock victim