rbeckman-nextgen / test-mc3

0 stars 0 forks source link

Deadlocks can still occur with Derby #4155

Open rbeckman-nextgen opened 4 years ago

rbeckman-nextgen commented 4 years ago

Windows ec2

java8

derby

When removing all messages a deadlock can still occur. {noformat} [2018-05-04 11:36:33,221] ERROR (com.mirth.connect.server.channel.LoggingTaskHandler:25): com.mirth.connect.donkey.server.data.DonkeyDaoException: java.sql.SQLTransactionRollbackException: A lock could not be obtained due to a deadlock, cycle of locks and waiters is: Lock : TABLE, SYSCONGLOMERATES, Tablelock Waiting XID : {44444, S} , APP, ALTER TABLE D_MC1 DROP CONSTRAINT D_MC1_FKEY Granted XID : {44442, IS} Lock : TABLE, SYSCONGLOMERATES, Tablelock Waiting XID : {44442, S} , APP, ALTER TABLE D_MC2 DROP CONSTRAINT D_MC2_FKEY Granted XID : {44442, IS} , {44444, IS} . The selected victim is XID : 44444.

at com.mirth.connect.donkey.server.data.jdbc.JdbcDao.deleteAllMessages(JdbcDao.java:1247)

at com.mirth.connect.donkey.server.data.buffered.BufferedDao.executeTasks(BufferedDao.java:130)

at com.mirth.connect.donkey.server.data.buffered.BufferedDao.commit(BufferedDao.java:85)

at com.mirth.connect.donkey.server.data.buffered.BufferedDao.commit(BufferedDao.java:67)

at com.mirth.connect.donkey.server.channel.Channel.removeAllMessages(Channel.java:912)

at com.mirth.connect.server.controllers.DonkeyEngineController$RemoveAllMessagesTask.execute(DonkeyEngineController.java:2094)

at com.mirth.connect.server.channel.ChannelTask.call(ChannelTask.java:67)

at com.mirth.connect.server.channel.ChannelTask.call(ChannelTask.java:16)

at java.util.concurrent.FutureTask.run(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: java.sql.SQLTransactionRollbackException: A lock could not be obtained due to a deadlock, cycle of locks and waiters is: Lock : TABLE, SYSCONGLOMERATES, Tablelock Waiting XID : {44444, S} , APP, ALTER TABLE D_MC1 DROP CONSTRAINT D_MC1_FKEY Granted XID : {44442, IS} Lock : TABLE, SYSCONGLOMERATES, Tablelock Waiting XID : {44442, S} , APP, ALTER TABLE D_MC2 DROP CONSTRAINT D_MC2_FKEY Granted XID : {44442, IS} , {44444, IS} . The selected victim is XID : 44444.

at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)

at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)

at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)

at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)

at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)

at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)

at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)

at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)

at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeLargeUpdate(Unknown Source)

at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)

at com.mirth.connect.donkey.server.data.jdbc.JdbcDao.deleteAllMessages(JdbcDao.java:1194)

... 11 more

Caused by: java.sql.SQLException: A lock could not be obtained due to a deadlock, cycle of locks and waiters is: Lock : TABLE, SYSCONGLOMERATES, Tablelock Waiting XID : {44444, S} , APP, ALTER TABLE D_MC1 DROP CONSTRAINT D_MC1_FKEY Granted XID : {44442, IS} Lock : TABLE, SYSCONGLOMERATES, Tablelock Waiting XID : {44442, S} , APP, ALTER TABLE D_MC2 DROP CONSTRAINT D_MC2_FKEY Granted XID : {44442, IS} , {44444, IS} . The selected victim is XID : 44444.

at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)

at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)

... 22 more

Caused by: ERROR 40001: A lock could not be obtained due to a deadlock, cycle of locks and waiters is: Lock : TABLE, SYSCONGLOMERATES, Tablelock Waiting XID : {44444, S} , APP, ALTER TABLE D_MC1 DROP CONSTRAINT D_MC1_FKEY Granted XID : {44442, IS} Lock : TABLE, SYSCONGLOMERATES, Tablelock Waiting XID : {44442, S} , APP, ALTER TABLE D_MC2 DROP CONSTRAINT D_MC2_FKEY Granted XID : {44442, IS} , {44444, IS} . The selected victim is XID : 44444.

at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)

at org.apache.derby.impl.services.locks.Deadlock.buildException(Unknown Source)

at org.apache.derby.impl.services.locks.ConcurrentLockSet.lockObject(Unknown Source)

at org.apache.derby.impl.services.locks.AbstractPool.lockObject(Unknown Source)

at org.apache.derby.impl.services.locks.ConcurrentPool.lockObject(Unknown Source)

at org.apache.derby.impl.store.raw.xact.ContainerLocking3.lockContainer(Unknown Source)

at org.apache.derby.impl.store.raw.data.BaseContainerHandle.useContainer(Unknown Source)

at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unknown Source)

at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unknown Source)

at org.apache.derby.impl.store.raw.xact.Xact.openContainer(Unknown Source)

at org.apache.derby.impl.store.access.conglomerate.OpenConglomerate.init(Unknown Source)

at org.apache.derby.impl.store.access.heap.Heap.openScan(Unknown Source)

at org.apache.derby.impl.store.access.RAMTransaction.openScan(Unknown Source)

at org.apache.derby.impl.store.access.RAMTransaction.openScan(Unknown Source)

at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaHeap(Unknown Source)

at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getConglomerateDescriptors(Unknown Source)

at org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor.drop(Unknown Source)

at org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor.drop(Unknown Source)

at org.apache.derby.impl.sql.execute.DDLSingleTableConstantAction.dropConstraint(Unknown Source)

at org.apache.derby.impl.sql.execute.DDLSingleTableConstantAction.dropConstraint(Unknown Source)

at org.apache.derby.impl.sql.execute.DropConstraintConstantAction.executeConstantAction(Unknown Source)

at org.apache.derby.impl.sql.execute.AlterTableConstantAction.executeConstantActionBody(Unknown Source)

at org.apache.derby.impl.sql.execute.AlterTableConstantAction.executeConstantAction(Unknown Source)

at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)

at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)

at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)

... 16 more

{noformat} Note: This may only occur when clearing messages from multiple channels simultaneously

Imported Issue. Original Details: Jira Issue Key: MIRTH-4299 Reporter: narupley Created: 2018-06-19T07:57:44.000-0700