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

Automation must not crash on cleanup when transaction is rollback-only

    XMLWordPrintable

    Details

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

      Description

      When an exception is raised by an operation executed by Automation, it marks the transaction as rollback-only and cleans up correctly. However when the transaction is marked rollback-only from lower-level code, the Automation cleanup attempts to use the core session and fails.

      In particular this can happen following NXP-25116 which now propagates ConcurrentUpdateExceptions without swallowing them.

      9.10 stack trace:

      Caused by: java.lang.RuntimeException: Exceptions during cleanup
              at org.nuxeo.ecm.webengine.jaxrs.context.RequestContext.dispose(RequestContext.java:99)
              at org.nuxeo.ecm.webengine.jaxrs.context.RequestContextFilter.run(RequestContextFilter.java:50)
              at org.nuxeo.ecm.webengine.jaxrs.HttpFilter.doFilter(HttpFilter.java:49)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.nuxeo.ecm.webengine.app.HeaderFixFilter.run(HeaderFixFilter.java:62)
              at org.nuxeo.ecm.webengine.jaxrs.HttpFilter.doFilter(HttpFilter.java:49)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.nuxeo.ecm.core.management.jtajca.internal.Log4jWebFilter.doFilter(Log4jWebFilter.java:69)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.nuxeo.ecm.platform.web.common.requestcontroller.filter.NuxeoRequestControllerFilter.doFilter(NuxeoRequestControllerFilter.java:176)
              ... 75 more
              Suppressed: org.nuxeo.ecm.core.api.NuxeoException: Cannot reconnect a CoreSession when transaction is marked rollback-only
                      at org.nuxeo.ecm.core.api.local.LocalSession.getSession(LocalSession.java:116)
                      at org.nuxeo.ecm.core.api.AbstractSession.save(AbstractSession.java:1490)
                      at org.nuxeo.ecm.automation.OperationContext.close(OperationContext.java:208)
                      at org.nuxeo.ecm.automation.jaxrs.io.operations.RestOperationContext$1.cleanup(RestOperationContext.java:56)
                      at org.nuxeo.ecm.webengine.jaxrs.context.RequestContext.dispose(RequestContext.java:95)
                      ... 87 more
      

        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 - 2 hours
                  2h