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

Fix AbstractRenditionBuilderWork cleanup NuxeoException

    XMLWordPrintable

    Details

    • Release Notes Summary:
      The Work cleanup is done without opening a new session.
    • Backlog priority:
      1,000
    • Sprint:
      nxplatform 11.1.13, nxplatform 11.1.14
    • Story Points:
      2

      Description

      Regression since NXP-27533 the cleanup checks for null session and opens a new one, this fails when done outside of a transaction.
      Work cleanup should be defensive and tries to not raise an exception.

      2019-06-19 20:24:17,473 ERROR [renditionBuilderPool-00,in:0,inCheckpoint:0,out:0,lastRead:1560974080427,lastTimer:0,wm:0,loop:493,rebalance assigned]
      [org.nuxeo.ecm.core.work.WorkComputation] Work id: rendition:6095ae0b-cd11-403f-aa91-85f06ada6259::user:testuser:tarExport title: Lazy Rendition for tarExport on 6095ae0b-cd11-403f-aa91-85f06ada6259 on behalf of testuser is in error, the work is skipped, record: Record
      {watermark=204600227572613120, wmDate=2019-06-19 20:24:17.335, flags=[DEFAULT], key='rendition:6095ae0b-cd11-403f-aa91-85f06ada6259::user:testuser:tarExport', data.length=1484, data="....sr.@org.nuxeo.ecm.platform.rendition.lazy.AutomationRenditionBuilderu. U....,...xr.Borg.nuxeo.ecm.platform.rendition.lazy.Ab"}
      
      2019-06-19 20:24:17,473 ERROR [renditionBuilderPool-00,in:0,inCheckpoint:0,out:0,lastRead:1560974080427,lastTimer:0,wm:0,loop:493,rebalance assigned]
      [org.nuxeo.ecm.core.work.AbstractWork] Exception during work: AutomationRenditionBuilder(, Progress(?%, ?/0), null)
      org.nuxeo.ecm.core.api.NuxeoException: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "pg_type_typname_nsp_index"
      Detail: Key (typname, typnamespace)=(kv_default, 2200) already exists.
      at org.nuxeo.ecm.core.storage.sql.kv.SQLKeyValueStore.lambda$runWithConnections$1(SQLKeyValueStore.java:362)
      at org.nuxeo.runtime.transaction.TransactionHelper.lambda$runWithoutTransaction$1(TransactionHelper.java:514)
      at org.nuxeo.runtime.transaction.TransactionHelper.runWithoutTransaction(TransactionHelper.java:528)
      at org.nuxeo.runtime.transaction.TransactionHelper.lambda$runWithoutTransaction(TransactionHelper.java:514)
      at org.nuxeo.ecm.core.storage.sql.kv.SQLKeyValueStore.runWithConnection(SQLKeyValueStore.java:358)
      at org.nuxeo.ecm.core.storage.sql.kv.SQLKeyValueStore.initialize(SQLKeyValueStore.java:180)
      at org.nuxeo.runtime.kv.KeyValueServiceImpl.getKeyValueStore(KeyValueServiceImpl.java:102)
      at org.nuxeo.ecm.core.work.WorkStateHelper.getKeyValueStore(WorkStateHelper.java:42)
      at org.nuxeo.ecm.core.work.WorkStateHelper.getLastOffset(WorkStateHelper.java:54)
      at org.nuxeo.ecm.core.work.WorkComputation.processRecord(WorkComputation.java:87)
      at org.nuxeo.lib.stream.computation.log.ComputationRunner.processRecord(ComputationRunner.java:285)
      at org.nuxeo.lib.stream.computation.log.ComputationRunner.processLoop(ComputationRunner.java:183)
      at org.nuxeo.lib.stream.computation.log.ComputationRunner.run(ComputationRunner.java:142)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
      Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "pg_type_typname_nsp_inex"
      Detail: Key (typname, typnamespace)=(kv_default, 2200) already exists.
      at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2476)
      at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2189)
      at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:300)
      at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)
      at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)
      at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:301)
      at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:287)
      at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:264)
      at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:260)
      at org.tranql.connector.jdbc.StatementHandle.execute(StatementHandle.java:119)
      at org.nuxeo.ecm.core.storage.sql.kv.SQLKeyValueStore.createTable(SQLKeyValueStore.java:426)
      at org.nuxeo.ecm.core.storage.sql.kv.SQLKeyValueStore.getTable(SQLKeyValueStore.java:211)
      at org.nuxeo.ecm.core.storage.sql.kv.SQLKeyValueStore.lambda$initialize$0(SQLKeyValueStore.java:182)
      at org.nuxeo.ecm.core.storage.sql.kv.SQLKeyValueStore.lambda$runWithConnection$1(SQLKeyValueStore.java:360)
      ... 17 more
      2019-06-19 20:24:17,473 ERROR [renditionBuilderPool-00,in:0,inCheckpoint:0,out:0,lastRead:1560974080427,lastTimer:0,wm:0,loop:493,rebalance assigned]
      [org.nuxeo.ecm.core.work.WorkComputation] Error during cleanup work: rendition:6095ae0b-cd11-403f-aa91-85f06ada6259::user:testuser:tarExport
      org.nuxeo.ecm.core.api.NuxeoException: Cannot create a CoreSession outside a transaction
      at org.nuxeo.ecm.core.api.local.LocalSession.<init>(LocalSession.java:76)
      at org.nuxeo.ecm.core.api.CoreSessionServiceImpl.createCoreSession(CoreSessionServiceImpl.java:43)
      at org.nuxeo.ecm.core.api.CoreInstance.openCoreSession(CoreInstance.java:163)
      at org.nuxeo.ecm.core.api.CoreInstance.openCoreSession(CoreInstance.java:71)
      at org.nuxeo.ecm.core.work.AbstractWork.openUserSession(AbstractWork.java:308)
      at org.nuxeo.ecm.platform.rendition.laz.AbstractRenditionBuilderWork.storeAnErrorRendition(AbstractRenditionBuilderWork.java:142)
      at org.nuxeo.ecm.platform.rendition.laz.AbstractRenditionBuilderWork.cleanUp(AbstractRenditionBuilderWork.java:132)
      at org.nuxeo.ecm.core.work.WorkComputation.cleanupWorkInFailure(WorkComputation.java:139)
      at org.nuxeo.ecm.core.work.WorkComputation.processRecord(WorkComputation.java:130)
      at org.nuxeo.lib.stream.computation.log.ComputationRunner.processRecord(ComputationRunner.java:285)
      at org.nuxeo.lib.stream.computation.log.ComputationRunner.processLoop(ComputationRunner.java:183)
      at org.nuxeo.lib.stream.computation.log.ComputationRunner.run(ComputationRunner.java:142)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 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