MySQL deadlock

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

問題

Deployment environment in queue state

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

診断

Confirm if MySQL is configured with READ-COMMITTED with the following query: 

SELECT @@session.tx_isolation;

原因

MySQL have to be configured with READ-COMMITTED transaction level as stated in MySQL.

ソリューション

  1. Configured MySQL server to use READ-COMMITTED transaction level, for example: 

    [mysqld]
    transaction-isolation=READ-COMMITTED
  2. Restart MySQL server
  3. Restart Bamboo

最終更新日: 2017 年 12 月 15 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.