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

Fix random test cleanup error in DiffPicturesOperationsTest

    XMLWordPrintable

    Details

    • Type: Clean up
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.10-HF01, 8.1
    • Component/s: Diff, Tests

      Description

      We sometimes get this on SQL Server:

      org.nuxeo.ecm.core.api.ConcurrentUpdateException: Failed to remove document 1013d80f-3d1a-4b1d-9e67-b7e34111cdbb, java.sql.SQLException: Transaction (Process ID 51) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCConnection.checkConcurrentUpdate(JDBCConnection.java:203)
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.deleteRowsDirect(JDBCRowMapper.java:858)
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.remove(JDBCRowMapper.java:1298)
      	at org.nuxeo.ecm.core.storage.sql.SoftRefCachingRowMapper.remove(SoftRefCachingRowMapper.java:429)
      	at org.nuxeo.ecm.core.storage.sql.PersistenceContext.removeNode(PersistenceContext.java:863)
      	at org.nuxeo.ecm.core.storage.sql.SessionImpl.removeNode(SessionImpl.java:1054)
      	at org.nuxeo.ecm.core.storage.sql.ra.ConnectionImpl.removeNode(ConnectionImpl.java:239)
      	at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.remove(SQLSession.java:599)
      	at org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive.remove(SQLDocumentLive.java:157)
      	at org.nuxeo.ecm.core.api.AbstractSession.removeNotifyOneDoc(AbstractSession.java:1326)
      	at org.nuxeo.ecm.core.api.AbstractSession.removeDocument(AbstractSession.java:1296)
      	at org.nuxeo.ecm.core.api.AbstractSession.removeDocument(AbstractSession.java:1286)
      	at org.nuxeo.diff.pictures.test.DiffPicturesOperationsTest.cleanup(DiffPicturesOperationsTest.java:112)
      

      This is due to a cleanup method doing a delete and running concurrently with an asynchronous process. We could do an explicit wait for async events to be completed, but even simpler we can remove the cleanup method given that the CoreFeature already takes care of it.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: