MySQL deadlock
Problem
Deployment environment in queue state
The following appears in the atlassian-bamboo.log
2017-08-30 15:45:24,062 ERROR [17-BAM::Default Agent::Agent:pool-32-thread-1] [AsynchronousAbleEventDispatcher] There was an exception thrown trying to dispatch event [com.atlassian.bamboo.deployments.execution.events.OutOfBandDeploymentTimingPoints$AgentAssigned@333850d7] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.atlassian.bamboo.deployments.execution.events.DeploymentExecutionEventListener.onDeploymentExecuted(com.atlassian.bamboo.deployments.execution.events.OutOfBandDeploymentTimingPoints$AgentAssigned), listener=com.atlassian.bamboo.deployments.execution.events.DeploymentExecutionEventListener@3b405fe3}]
java.lang.RuntimeException: Could not commit Hibernate transaction; nested exception is org.hibernate.TransactionException: Unable to commit against JDBC Connection
at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54)
at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:46)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:299)
at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:105)
at com.atlassian.bamboo.event.spi.BambooEventDispatcher.dispatch(BambooEventDispatcher.java:34)
at com.atlassian.event.internal.LockFreeEventPublisher$Publisher.dispatch(LockFreeEventPublisher.java:260)
at com.atlassian.event.internal.LockFreeEventPublisher.publish(LockFreeEventPublisher.java:102)
at com.atlassian.bamboo.event.TxAwareEventPublisher.publish(TxAwareEventPublisher.java:20)
at com.atlassian.bamboo.v2.build.timing.TimingPointServiceImpl.publish(TimingPointServiceImpl.java:31)
at com.atlassian.bamboo.v2.build.timing.TimingPointServiceImpl.publish(TimingPointServiceImpl.java:21)
at com.atlassian.bamboo.execution.ExecutionPhaseServiceImpl.agentAssigned(ExecutionPhaseServiceImpl.java:64)
at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:97)
at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:126)
at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:47)
at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26)
at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17)
at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.transaction.TransactionSystemException: Could not commit Hibernate transaction; nested exception is org.hibernate.TransactionException: Unable to commit against JDBC Connection
...
Caused by: org.hibernate.TransactionException: Unable to commit against JDBC Connection
...
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction
Diagnosis
Confirm if MySQL is configured with READ-COMMITTED
with the following query:
SELECT @@session.tx_isolation;
Cause
MySQL have to be configured with READ-COMMITTED
transaction level as stated in Connect Bamboo to a MySQL database.
Resolution
Configured MySQL server to use READ-COMMITTED transaction level, for example:
[mysqld] transaction-isolation=READ-COMMITTED
- Restart MySQL server
- Restart Bamboo
Last modified on Dec 15, 2017
Powered by Confluence and Scroll Viewport.