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

REST API thread safety issue

    XMLWordPrintable

    Details

      Description

      In some rare situations, under load, the following stack trace can be observed:

      Caused by: java.lang.ClassCastException: org.nuxeo.ecm.core.api.impl.DocumentModelImpl cannot be cast to java.util.List
              at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelListJsonWriter.write(DocumentModelListJsonWriter.java:42)
              at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter.write(AbstractJsonWriter.java:81)
              at org.nuxeo.ecm.webengine.jaxrs.coreiodelegate.PartialCoreIODelegate.writeTo(PartialCoreIODelegate.java:114)
              at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:302)
              at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1510)
              at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
              at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
              at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
              at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
              at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
              at org.nuxeo.ecm.webengine.app.jersey.WebEngineServlet.containerService(WebEngineServlet.java:72)
      

      It seems that PartialCoreIODelegate uses a wrong writer for the given entity type. This is due to the writer field that is used by several threads at the same time.

        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 - 1 hour
                  1h