Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-26035

Fix random in TestSetSystemProperties on h2

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.3
    • Component/s: Bulk

      Description

      h2 lock write by table and not per line so TestSetSystemProperties that use 2 threads to update the system properties run into concurrent exception:

      2018-10-25 10:19:02,706 [setSystemPropertiesPool-00] ERROR [ComputationRunner] setSystemProperties: Exception in processLoop: Failed to save session, org.h2.jdbc.JdbcBatchUpdateException: Timeout trying to lock table ; SQL statement:
      UPDATE "HIERARCHY" SET "ISTRASHED" = ?, "SYSTEMCHANGETOKEN" = "SYSTEMCHANGETOKEN" + ? WHERE "ID" = ? [50200-177]
      org.nuxeo.ecm.core.api.ConcurrentUpdateException: Failed to save session, org.h2.jdbc.JdbcBatchUpdateException: Timeout trying to lock table ; SQL statement:
      UPDATE "HIERARCHY" SET "ISTRASHED" = ?, "SYSTEMCHANGETOKEN" = "SYSTEMCHANGETOKEN" + ? WHERE "ID" = ? [50200-177]
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCConnection.checkConcurrentUpdate(JDBCConnection.java:184) ~[nuxeo-core-storage-sql-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.updateSimpleRows(JDBCRowMapper.java:649) ~[nuxeo-core-storage-sql-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.writeUpdates(JDBCRowMapper.java:478) ~[nuxeo-core-storage-sql-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.write(JDBCRowMapper.java:440) ~[nuxeo-core-storage-sql-10.3-SNAPSHOT.jar:?]
      	at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source) ~[?:?]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.doInvoke(JDBCMapperConnector.java:111) ~[nuxeo-core-storage-sql-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.lambda$doConnectAndInvoke$0(JDBCMapperConnector.java:98) ~[nuxeo-core-storage-sql-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:589) ~[nuxeo-runtime-jtajca-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.doConnectAndInvoke(JDBCMapperConnector.java:95) ~[nuxeo-core-storage-sql-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.invoke(JDBCMapperConnector.java:84) ~[nuxeo-core-storage-sql-10.3-SNAPSHOT.jar:?]
      	at com.sun.proxy.$Proxy166.write(Unknown Source) ~[?:?]
      	at org.nuxeo.ecm.core.storage.sql.SoftRefCachingRowMapper.write(SoftRefCachingRowMapper.java:360) ~[nuxeo-core-storage-sql-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.storage.sql.SessionImpl.doFlush(SessionImpl.java:358) ~[nuxeo-core-storage-sql-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.storage.sql.SessionImpl.flush(SessionImpl.java:330) ~[nuxeo-core-storage-sql-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.storage.sql.SessionImpl.save(SessionImpl.java:309) ~[nuxeo-core-storage-sql-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.storage.sql.ra.ConnectionImpl.save(ConnectionImpl.java:174) ~[nuxeo-core-storage-sql-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.save(SQLSession.java:140) ~[nuxeo-core-storage-sql-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.api.AbstractSession.save(AbstractSession.java:1486) ~[nuxeo-core-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.bulk.action.SetSystemPropertiesAction$SetSystemPropertyComputation.compute(SetSystemPropertiesAction.java:94) ~[nuxeo-core-bulk-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.bulk.action.computation.AbstractBulkComputation.lambda$processBatchOfDocuments$0(AbstractBulkComputation.java:132) ~[nuxeo-core-bulk-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.runtime.transaction.TransactionHelper.lambda$runInTransaction$3(TransactionHelper.java:569) ~[nuxeo-runtime-jtajca-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:589) ~[nuxeo-runtime-jtajca-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:569) ~[nuxeo-runtime-jtajca-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.bulk.action.computation.AbstractBulkComputation.processBatchOfDocuments(AbstractBulkComputation.java:127) ~[nuxeo-core-bulk-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.bulk.action.computation.AbstractBulkComputation.processRecord(AbstractBulkComputation.java:85) ~[nuxeo-core-bulk-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.lib.stream.computation.log.ComputationRunner.processRecord(ComputationRunner.java:285) ~[nuxeo-stream-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.lib.stream.computation.log.ComputationRunner.processLoop(ComputationRunner.java:194) ~[nuxeo-stream-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.lib.stream.computation.log.ComputationRunner.run(ComputationRunner.java:152) [nuxeo-stream-10.3-SNAPSHOT.jar:?]
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_181]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_181]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_181]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_181]
      	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
      Caused by: org.h2.jdbc.JdbcBatchUpdateException: Timeout trying to lock table ; SQL statement:
      UPDATE "HIERARCHY" SET "ISTRASHED" = ?, "SYSTEMCHANGETOKEN" = "SYSTEMCHANGETOKEN" + ? WHERE "ID" = ? [50200-177]
      	at org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.java:1199) ~[h2-1.4.177-NX01.jar:1.4.177]
      	at org.tranql.connector.jdbc.StatementHandle.executeBatch(StatementHandle.java:155) ~[tranql-connector-1.8.jar:1.8]
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.updateSimpleRows(JDBCRowMapper.java:623) ~[nuxeo-core-storage-sql-10.3-SNAPSHOT.jar:?]
      	... 33 more
      

      seen here:

      https://qa.nuxeo.org/jenkins/job/master/job/nuxeo-master/org.nuxeo.ecm.core$nuxeo-core-test/2013/testReport/junit/org.nuxeo.ecm.core.bulk/TestSetSystemPropertiesAction/testSetSystemProperties/

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h