Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2.14
-
Component/s: Database, DB Cleaner
-
Labels:None
-
Environment:Windows 2003 R2, Hudson 1.343, Maven 2.0.9, Sonar 1.11, SQL Server 2008, jtds 1.2.2 JDBC driver distributed with Sonar
-
Number of attachments :
Description
We run sonar nightly jobs from hudson for all our development and all run at the same time at midnight causing 2 jobs to error. The exact spot in the stacktrace below.
[INFO] Sensor SurefireSensor done: 21 ms
[INFO] Execute decorators...
[INFO] ANALYSIS SUCCESSFUL, you can browse
[INFO] Database optimization...
[WARN] SQL Error: 1205, SQLState: 40001
[ERROR] Transaction (Process ID 161) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Can not execute Sonar
Embedded error: org.hibernate.exception.LockAcquisitionException: could not execute query
Transaction (Process ID 161) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Can not execute Sonar
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
deadlock with..................................
[INFO] Sensor VersionEventsSensor done: 91 ms
[INFO] Sensor SurefireSensor done: 23 ms
[INFO] Execute decorators...
[INFO] ANALYSIS SUCCESSFUL, you can browse
[INFO] Database optimization...
[WARN] SQL Error: 1205, SQLState: 40001
[ERROR] Transaction (Process ID 168) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Can not execute Sonar
Embedded error: org.hibernate.exception.LockAcquisitionException: could not execute query
Transaction (Process ID 168) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Can not execute Sonar
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
Any ideas, why does it fail on optimization step? Whats the workaround if any.
Thanks
Issue Links
- depends upon
-
SONAR-2757
Refactor the purge mechanisms to prevent any fullscan SQL requests on snapshots table
-
- is related to
-
SONAR-3043
Do not purge snapshots systematically
-
-
SONAR-2961
Fail silently when deadlock happens during a purge
-
- relates to
-
SONAR-1945
Database deadlocks on Sonar 2.2 and MySQL
-
Activity
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Freddy Mallet [ freddy.mallet ] |
| Summary | CLONE -Database deadlocks while purging database on Sonar 1.11 and SQL Server 2008 | -Database deadlocks while purging database on Sonar 2.3 and SQL Server 2005 |
| Description |
When two jobs are analyzed in Sonar at the same time, a deadlock error while purging the database produces that the build fails. I see two possible bugs or configuration issues here: 1. As the analysis has been done, and it's available in the dashboard, this concrete error could be a warning, thus the build do not fail. 2. Is this a driver related or database parameter related issue? We are investigating this but any help could be appreciated. Below an extract from the job execution console: ------------------------------------------------ ... [INFO] Executing sensor class org.sonar.plugins.core.sensors.ProfileSensor [INFO] Executing sensor class org.sonar.plugins.core.sensors.ProjectLinksSensor [INFO] Executing sensor class org.sonar.plugins.core.sensors.VersionEventsSensor [INFO] Executing sensor class org.sonar.plugins.squid.SquidSensor [INFO] Starting audit... [INFO] Audit done. [INFO] Execute decorators... [INFO] ANALYSIS SUCCESSFUL, you can browse http://xxxxx/sonar [INFO] Purging database... [WARN] SQL Error: 1205, SQLState: 40001 [ERROR] Transaction (Process ID 66) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Can not execute Sonar Embedded error: org.hibernate.exception.LockAcquisitionException: could not execute query Transaction (Process ID 66) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 11 minutes 22 seconds [INFO] Finished at: Wed Mar 17 04:15:38 CET 2010 [INFO] Final Memory: 38M/169M [INFO] ------------------------------------------------------------------------ Sending e-mails to: xxxxx channel stopped Sending e-mails to: xxxxx Finished: FAILURE |
We run sonar nightly jobs from hudson for all our development and all run at the same time at midnight causing 2 jobs to error. The exact spot in the stacktrace below.
[INFO] Sensor SurefireSensor done: 21 ms [INFO] Execute decorators... [INFO] ANALYSIS SUCCESSFUL, you can browse [INFO] Database optimization... [WARN] SQL Error: 1205, SQLState: 40001 [ERROR] Transaction (Process ID 161) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Can not execute Sonar Embedded error: org.hibernate.exception.LockAcquisitionException: could not execute query Transaction (Process ID 161) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. [INFO] ------------------------------------------------------------------------ [INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Can not execute Sonar at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569) deadlock with.................................. [INFO] Sensor VersionEventsSensor done: 91 ms [INFO] Sensor SurefireSensor done: 23 ms [INFO] Execute decorators... [INFO] ANALYSIS SUCCESSFUL, you can browse [INFO] Database optimization... [WARN] SQL Error: 1205, SQLState: 40001 [ERROR] Transaction (Process ID 168) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Can not execute Sonar Embedded error: org.hibernate.exception.LockAcquisitionException: could not execute query Transaction (Process ID 168) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. [INFO] ------------------------------------------------------------------------ [INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Can not execute Sonar at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) Any ideas, why does it fail on optimization step? Whats the workaround if any. Thanks |
| Summary | -Database deadlocks while purging database on Sonar 2.3 and SQL Server 2005 | Database deadlocks while purging database on Sonar 2.3 and SQL Server 2005 |
| Assignee | Freddy Mallet [ freddy.mallet ] | |
| Component/s | Database [ 13193 ] | |
| Component/s | DB Purge [ 14032 ] |
| Link |
This issue relates to |
| Link |
This issue depends upon |
| Fix Version/s | 2.14 [ 18034 ] |
| Link |
This issue is related to |
| Link |
This issue is related to |
| Assignee | Simon Brandhof [ simon.brandhof ] |
| Assignee | Simon Brandhof [ simon.brandhof ] | Freddy Mallet [ freddy.mallet ] |
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
| Status | Resolved [ 5 ] | Closed [ 6 ] |