SAP Knowledge Base Article - Preview

2712670 - StackOverflowError and maxed out threads waiting for ReentrantReadWriteLock

Symptom

This is a very specific scenario for which the below symptoms are observed. There are other possible scenarios for which the first three symptoms will be observed without the last two - these are different cases.

  1. The performance of the server downgrades to a level that renders the admin cockpit and/or storefront unusable.
  2. The number of threads increases to its maximum configured value.
  3. A large majority of threads are waiting for a ReadLock:
    "Thread-2305" prio=5 tid=0x4080 nid=0xff0 WAITING - stats: cpu=6 blk=-1 wait=-1
    java.lang.Thread.State: WAITING
    at sun.misc.Unsafe.park(Native Method)
    parking to wait for java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync@10bb31f9
    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)
  4. A single thread waiting for a WriteLock:
    "Thread-1524" prio=5 tid=0x2698 nid=0xa8a WAITING - stats: cpu=679297 blk=-1 wait=-1
    java.lang.Thread.State: WAITING
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync@10bb31f9
    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.acquireQueued(AbstractQueuedSynchronizer.java:867)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1197)
    at java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock.lock(ReentrantReadWriteLock.java:945)
  5. At the same time, the console.log shows a StackOverflowError which involves a WriteLock in the stack trace:
    SEVERE: >>java.lang.StackOverflowError
    INFO | jvm 1 | main | 2018/07/12 14:52:48.000 | >> at java.util.concurrent.locks.AbstractQueuedSynchronizer.compareAndSetTail(AbstractQueuedSynchronizer.java:2309)
    INFO | jvm 1 | main | 2018/07/12 14:52:48.000 | >> at java.util.concurrent.locks.AbstractQueuedSynchronizer.cancelAcquire(AbstractQueuedSynchronizer.java:763)
    INFO | jvm 1 | main | 2018/07/12 14:52:48.000 | >> at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:873)
    INFO | jvm 1 | main | 2018/07/12 14:52:48.000 | >> at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1197)
    INFO | jvm 1 | main | 2018/07/12 14:52:48.000 | >> at java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock.lock(ReentrantReadWriteLock.java:945)
    INFO | jvm 1 | main | 2018/07/12 14:52:48.000 | >> at net.sf.ehcache.store.chm.SelectableConcurrentHashMap$Segment.remove(SelectableConcurrentHashMap.java:563)
    INFO | jvm 1 | main | 2018/07/12 14:52:48.000 | >> at net.sf.ehcache.store.chm.SelectableConcurrentHashMap.remove(SelectableConcurrentHashMap.java:393)
    INFO | jvm 1 | main | 2018/07/12 14:52:48.000 | >> at net.sf.ehcache.store.MemoryStore.remove(MemoryStore.java:359)
    INFO | jvm 1 | main | 2018/07/12 14:52:48.000 | >> at net.sf.ehcache.Cache.removeInternal(Cache.java:2401)
    INFO | jvm 1 | main | 2018/07/12 14:52:48.000 | >> at net.sf.ehcache.Cache.removeAndReturnElement(Cache.java:2246)
    INFO | jvm 1 | main | 2018/07/12 14:52:48.000 | >> at de.hybris.platform.regioncache.region.impl.EHCacheRegion.remove(EHCacheRegion.java:444)
    
    


Read more...

Environment

This issue is independent of the environment - any synchronous code is susceptible to it.

Product

SAP Commerce 1811 ; SAP Hybris Commerce 1808 ; SAP Hybris Commerce 6.0 ; SAP Hybris Commerce 6.1 ; SAP Hybris Commerce 6.2 ; SAP Hybris Commerce 6.3 ; SAP Hybris Commerce 6.4 ; SAP Hybris Commerce 6.5 ; SAP Hybris Commerce 6.6 ; SAP Hybris Commerce 6.7 ; SAP hybris Commerce 5.0.3 ; SAP hybris Commerce 5.0.4 ; SAP hybris Commerce 5.7 ; SAP hybris Commerce Suite 5.2 ; SAP hybris Commerce Suite 5.3 ; SAP hybris Commerce Suite 5.4 ; SAP hybris Commerce Suite 5.5 ; SAP hybris Commerce Suite 5.5-1 ; SAP hybris Commerce Suite 5.6 ; hybris Commerce Suite 4.4 ; hybris Commerce Suite 4.5 ; hybris Commerce Suite 4.6 ; hybris Commerce Suite 4.7 ; hybris Commerce Suite 4.8 ; hybris Commerce Suite 5.0 ; hybris Commerce Suite 5.1 ; hybris Commerce Suite 5.1.1

Keywords

  • StackOverflowException
  • SOE
  • hybris
  • Commerce
  • Tomcat
  • maxThreads
  • lock
  • Synchronized
  • infinite loop
, KBA , CEC-COM-CPS , SAP Commerce , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP ONE Support launchpad (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.