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

Fix RetentionManager init

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.10-HF27, 11.1, 2021.0
    • Component/s: Retention
    • Tags:
    • Team:
      FG
    • Sprint:
      nxFG 11.1.13
    • Story Points:
      2

      Description

      Unit tests logs show that RetentionManagerImpl initializes its acceptedEvents list in a lazy way and too early (so has to retry many times until directories are available).
      In addition this is done during an afterCompletion hook, which is bad as it's in a transactional context where some things can't be done (like creating a new directory session in a future master branch).

      Logs during tests:

      [main] TRACE [RetentionManagerImpl] Empty accepted events, not catching anything
      
      [Nuxeo-Work-default-2:1445541614399448.1215375064] WARN  [TransactionImpl] Unexpected exception from afterCompletion; continuing
      java.lang.NullPointerException: null
      	at org.nuxeo.retention.service.RetentionManagerImpl.getAcceptedEvents(RetentionManagerImpl.java:320) ~[main/:?]
      	at org.nuxeo.retention.listeners.RetentionDocumentEventListener.acceptEvent(RetentionDocumentEventListener.java:62) ~[main/:?]
      	at org.nuxeo.ecm.core.event.impl.EventListenerDescriptor.acceptBundle(EventListenerDescriptor.java:299) ~[main/:?]
      	at org.nuxeo.ecm.core.event.impl.PostCommitEventExecutor.run(PostCommitEventExecutor.java:143) ~[main/:?]
      	at org.nuxeo.ecm.core.event.impl.PostCommitEventExecutor.run(PostCommitEventExecutor.java:131) ~[main/:?]
      	at org.nuxeo.ecm.core.event.impl.EventServiceImpl.fireEventBundle(EventServiceImpl.java:335) ~[main/:?]
      	at org.nuxeo.ecm.core.event.impl.EventServiceImpl.handleTxCommited(EventServiceImpl.java:515) ~[main/:?]
      	at org.nuxeo.ecm.core.event.impl.EventServiceImpl.afterCompletion(EventServiceImpl.java:496) ~[main/:?]
      	at org.apache.geronimo.transaction.manager.TransactionImpl.afterCompletion(TransactionImpl.java:540) [geronimo-transaction-2.2.1.jar:2.2.1]
      	at org.apache.geronimo.transaction.manager.TransactionImpl.afterCompletion(TransactionImpl.java:533) [geronimo-transaction-2.2.1.jar:2.2.1]
      	at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:329) [geronimo-transaction-2.2.1.jar:2.2.1]
      	at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:252) [geronimo-transaction-2.2.1.jar:2.2.1]
      	at org.nuxeo.runtime.jtajca.NuxeoContainer$UserTransactionImpl.commit(NuxeoContainer.java:538) [main/:?]
      	at org.nuxeo.runtime.transaction.TransactionHelper.commitOrRollbackTransaction(TransactionHelper.java:393) [main/:?]
      	at org.nuxeo.ecm.core.work.AbstractWork.runWorkWithTransaction(AbstractWork.java:522) [main/:?]
      	at org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:383) [main/:?]
      	at org.nuxeo.ecm.core.work.WorkHolder.run(WorkHolder.java:57) [main/:?]
      

        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