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

Infinite loop on high concurrent access to ComplexTypeImpl.getField

    XMLWordPrintable

    Details

      Description

      On high concurrency access to ComplexTypeImpl.getField can lead to infinite loop on HashMap.get.

      The result is that all thread will be blocked in HashMap.get consuming all CPU without end.

      Looking at a thread dump will show many threads like this

      ajp-XXXXX-8009-49" daemon prio=10 tid=0x000000005052a800 nid=0x31c1 runnable [0x0000000048263000]
         java.lang.Thread.State: RUNNABLE
      	at java.util.HashMap.get(HashMap.java:303)
      	at org.nuxeo.ecm.core.schema.types.ComplexTypeImpl.getField(ComplexTypeImpl.java:103)
      	at org.nuxeo.ecm.core.schema.types.CompositeTypeImpl.getField(CompositeTypeImpl.java:123)
      	at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.makeProperties(SQLSession.java:846)
      	at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.makeProperty(SQLSession.java:823)
      	at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexProperty.getProperty(SQLComplexProperty.java:119)
      	at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexProperty.setPropertyValue(SQLComplexProperty.java:209)
      	at org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive.writeDocumentPart(SQLDocumentLive.java:171)
      	at org.nuxeo.ecm.core.api.AbstractSession.writeModel(AbstractSession.java:495)
      	at org.nuxeo.ecm.core.api.AbstractSession.createDocument(AbstractSession.java:816)
      	at org.nuxeo.ecm.core.api.ejb.DocumentManagerBean.createDocument(DocumentManagerBean.java:261)
      

      This happens because HashMap is not thread safe and access should be synchronized.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: