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

Deadlock + infinite loop in request filter at high load

    XMLWordPrintable

    Details

      Description

      A deadlock appears in rare cases in the request controller filter.
      One thread is doing:

         java.lang.Thread.State: RUNNABLE
      	at java.util.LinkedHashMap.transfer(LinkedHashMap.java:253)
      	at java.util.HashMap.resize(HashMap.java:564)
      	at java.util.HashMap.addEntry(HashMap.java:851)
      	at java.util.LinkedHashMap.addEntry(LinkedHashMap.java:427)
      	at java.util.HashMap.put(HashMap.java:484)
      	at org.nuxeo.ecm.platform.web.common.requestcontroller.service.RequestControllerService.getConfigForRequest(RequestControllerService.java:106)
      

      And all the other threads are blocked in:

         java.lang.Thread.State: WAITING (parking)
      	at sun.misc.Unsafe.park(Native Method)
      	- parking to wait for  <0x0000000702dd51d8> (a java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync)
      	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
      	at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
      	at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireShared(AbstractQueuedSynchronizer.java:964)
      	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShared(AbstractQueuedSynchronizer.java:1282)
      	at java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lock(ReentrantReadWriteLock.java:731)
      	at org.nuxeo.ecm.platform.web.common.requestcontroller.service.RequestControllerService.getConfigForRequest(RequestControllerService.java:97)
      

      The first thread is in an infinite loop due to a corrupted LinkedHashMap. It's corrupted due to concurrent reads, which is a problem as the map is used in LRU mode (and therefore is modified on read). The other threads are waiting on a lock acquired by the first thread.

        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 - 30 minutes
                  30m