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

Concurrent update exception should never be swallowed

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 9.10, 10.1
    • Fix Version/s: 9.10-HF10, 10.2
    • Component/s: Core IO

      Description

      1. install nuxeo with a relational database (H2, pgSQL, ...)
      2. install quota add-on
      3. start nuxeo
      4. start the attached script
      5. observe the output:
        curl: (18) transfer closed with outstanding read data remaining
        curl: (18) transfer closed with outstanding read data remaining
        curl: (18) transfer closed with outstanding read data remaining
        curl: (18) transfer closed with outstanding read data remaining
        curl: (18) transfer closed with outstanding read data remaining
        
      6. observe the stack in the logs:
        2018-06-04 14:22:48,320 ERROR [http-nio-0.0.0.0-8080-exec-7] [org.nuxeo.ecm.core.event.impl.EventServiceImpl] Exception during quotaStatsListener sync listener execution, continuing to run other listeners
        org.nuxeo.ecm.core.api.ConcurrentUpdateException: Failed to save session, java.sql.BatchUpdateException: Batch entry 0 INSERT INTO "documents_size_statistics" ("id", "innersize", "sizetrash", "maxsize", "totalsize", "sizeversions") VALUES ('13e93466-8fdc-4cfd-9b18-a946d4846302', NULL, NULL, NULL, 72998, NULL) was aborted: ERROR: duplicate key value violates unique constraint "documents_size_statistics_pk"
          Détail : Key (id)=(13e93466-8fdc-4cfd-9b18-a946d4846302) already exists.  Call getNextException to see other errors in the batch.
        	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCConnection.checkConcurrentUpdate(JDBCConnection.java:184)
        	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.insertSimpleRows(JDBCRowMapper.java:561)
        	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.writeCreates(JDBCRowMapper.java:471)
        	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.write(JDBCRowMapper.java:444)
        	at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	at java.lang.reflect.Method.invoke(Method.java:498)
        	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.doInvoke(JDBCMapperConnector.java:111)
        	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.lambda$doConnectAndInvoke$0(JDBCMapperConnector.java:98)
        	at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:589)
        	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.doConnectAndInvoke(JDBCMapperConnector.java:95)
        	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.invoke(JDBCMapperConnector.java:84)
        	at com.sun.proxy.$Proxy65.write(Unknown Source)
        	at org.nuxeo.ecm.core.storage.sql.SoftRefCachingRowMapper.write(SoftRefCachingRowMapper.java:360)
        	at org.nuxeo.ecm.core.storage.sql.SessionImpl.doFlush(SessionImpl.java:369)
        	at org.nuxeo.ecm.core.storage.sql.SessionImpl.flush(SessionImpl.java:342)
        	at org.nuxeo.ecm.core.storage.sql.SessionImpl.save(SessionImpl.java:321)
        	at org.nuxeo.ecm.core.storage.sql.ra.ConnectionImpl.save(ConnectionImpl.java:173)
        	at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.save(SQLSession.java:139)
        	at org.nuxeo.ecm.core.api.AbstractSession.save(AbstractSession.java:1490)
        	at org.nuxeo.ecm.quota.count.DocumentsCountUpdater.updateCountStatistics(DocumentsCountUpdater.java:154)
        	at org.nuxeo.ecm.quota.count.DocumentsCountUpdater.processDocumentCreated(DocumentsCountUpdater.java:67)
        	at org.nuxeo.ecm.quota.AbstractQuotaStatsUpdater.updateStatistics(AbstractQuotaStatsUpdater.java:110)
        	at org.nuxeo.ecm.quota.QuotaStatsServiceImpl$1.run(QuotaStatsServiceImpl.java:100)
        	at org.nuxeo.ecm.core.api.UnrestrictedSessionRunner.runUnrestricted(UnrestrictedSessionRunner.java:117)
        	at org.nuxeo.ecm.quota.QuotaStatsServiceImpl.updateStatistics(QuotaStatsServiceImpl.java:103)
        	at org.nuxeo.ecm.quota.QuotaStatsListener.handleEvent(QuotaStatsListener.java:76)
        	at org.nuxeo.ecm.core.event.impl.EventServiceImpl.fireEvent(EventServiceImpl.java:242)
        	at org.nuxeo.ecm.core.api.AbstractSession.notifyEvent(AbstractSession.java:271)
        	at org.nuxeo.ecm.core.api.AbstractSession.createDocument(AbstractSession.java:733)
        	at org.nuxeo.ecm.platform.filemanager.service.extension.AbstractFileImporter.create(AbstractFileImporter.java:227)
        	at org.nuxeo.ecm.platform.filemanager.service.FileManagerService.createDocumentFromBlob(FileManagerService.java:260)
        	at org.nuxeo.ecm.automation.core.operations.services.FileManagerImport.run(FileManagerImport.java:76)
        	at org.nuxeo.ecm.automation.core.operations.services.FileManagerImport.run(FileManagerImport.java:84)
        

        Attachments

        1. import_docs.sh
          5 kB
        2. import_quota_docs.sh
          3 kB
        3. server.log
          716 kB

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 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 - 2 hours
                  2h

                    PagerDuty

                    Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.