Support Article

Thread Dump starts and entered into Unsafe.park(Native Method)

SA-28672

Summary



In Production sporadically thread are generating and bringing the application down.

Error Messages



"PegaRULES-Batch-26" Id=166 in BLOCKED on lock=com.pega.pegarules.exec.internal.util.classloader.PRClassLoaderDB$ClassDefinition@5a29d872
     owned by PegaRULES-Batch-25 Id=165
BlockedCount : 6610, BlockedTime : -1, WaitedCount : 9804, WaitedTime : -1
    at com.pega.pegarules.exec.internal.util.classloader.PRClassLoaderDB$ClassDefinition.getElementIterator(PRClassLoaderDB.java:1512)
    at com.pega.pegarules.exec.internal.util.classloader.PRClassLoaderDB.getCacheSnapshot(PRClassLoaderDB.java:1204)
    at com.pega.pegarules.monitor.internal.context.RuleUsageImpl.updateSnapshot(RuleUsageImpl.java:280)
    at com.pega.pegarules.session.internal.mgmt.Executable.updateRuleUsageSnapshot(Executable.java:8077)
    at com.pegarules.generated.activity.ra_action_ruleusagesnapshot_8acf7559930ab416e0609201cc19c6af.step1_circum0(ra_action_ruleusagesnapshot_8acf7559930ab416e0609201cc19c6af.java:177)
    at com.pegarules.generated.activity.ra_action_ruleusagesnapshot_8acf7559930ab416e0609201cc19c6af.perform(ra_action_ruleusagesnapshot_8acf7559930ab416e0609201cc19c6af.java:69)
    at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3505)
    at com.pega.pegarules.session.internal.async.agent.QueueProcessor.runActivity(QueueProcessor.java:721)
    at com.pega.pegarules.session.internal.async.agent.QueueProcessor.execute(QueueProcessor.java:602)
    at com.pega.pegarules.session.internal.async.BatchRequestorTask.run(BatchRequestorTask.java:945)
    at com.pega.pegarules.session.internal.PRSessionProviderImpl.performTargetActionWithLock(PRSessionProviderImpl.java:1259)
    at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:1008)
    at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:901)
    at com.pega.pegarules.session.internal.async.BatchRequestorTask.run(BatchRequestorTask.java:670)
    at com.pega.jsr166backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:991)
    at com.pega.jsr166backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:532)
    at java.lang.Thread.run(Thread.java:745)
 
    Locked synchronizers: count = 3
      - java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync@7035eec0
      - java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync@64cdb8cd
      - com.pega.jsr166backport.java.util.concurrent.locks.ReentrantLock$NonfairSync@7e1fce6e
 
"PegaRULES-Batch-25" Id=165 in WAITING on lock=java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync@64cdb8cd
     owned by PegaRULES-Batch-26 Id=166
BlockedCount : 6600, BlockedTime : -1, WaitedCount : 9803, WaitedTime : -1
    at sun.misc.Unsafe.park(Native Method)
    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 com.pega.pegarules.exec.internal.util.classloader.PRClassLoaderDB.getDefinitionForName(PRClassLoaderDB.java:563)
    at com.pega.pegarules.exec.internal.util.classloader.PRClassLoaderDB.getEntryForName(PRClassLoaderDB.java:582)
    at com.pega.pegarules.exec.internal.util.classloader.PRClassLoaderDB.getLoadedClass(PRClassLoaderDB.java:595)
    at com.pega.pegarules.exec.internal.util.classloader.PRClassLoaderDB.loadClass(PRClassLoaderDB.java:1053)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at com.pega.pegarules.exec.internal.util.classloader.PRClassLoaderDB$Loader.loadClass(PRClassLoaderDB.java:2137)
      - locked com.pega.pegarules.exec.internal.util.classloader.PRClassLoaderDB@5847c7d4
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at com.pega.pegarules.exec.internal.util.classloader.PRClassLoaderDB$Loader.loadClass(PRClassLoaderDB.java:2226)
    at com.pega.pegarules.exec.internal.util.classloader.PRClassLoaderDB$ClassElement.getClassForEntry(PRClassLoaderDB.java:1807)
      - locked com.pega.pegarules.exec.internal.util.classloader.PRClassLoaderDB$ClassDefinition@5a29d872
    at com.pega.pegarules.exec.internal.util.classloader.PRClassLoaderDB.findClass(PRClassLoaderDB.java:931)
    at com.pega.pegarules.exec.internal.util.classloader.PRClassLoaderDB.loadClass(PRClassLoaderDB.java:1065)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at com.pega.pegarules.generation.internal.library.LibraryMetadataCache$LibraryClassImplementation.<init>(LibraryMetadataCache.java:71)
    at com.pega.pegarules.generation.internal.library.LibraryMetadataCache.getFunctionInstance(LibraryMetadataCache.java:318)
    at com.pega.pegarules.generation.internal.library.LibraryRuntime.resolveAndinvokeFunctionViaReflection(LibraryRuntime.java:124)
    at com.pega.pegarules.generation.internal.library.LibraryRuntime.invokeLibraryRuntime(LibraryRuntime.java:110)
    at com.pega.pegarules.generation.internal.library.LibraryFunctionUtilityImpl.resolveMethodCall(LibraryFunctionUtilityImpl.java:3138)
    at com.pega.pegarules.session.internal.mgmt.Executable.resolveMethodCall(Executable.java:11077)
    at com.pegarules.generated.activity.ra_action_getnodeidtorun_a1695ca03cc81308cfabd9dc35785ea9.step7_circum0(ra_action_getnodeidtorun_a1695ca03cc81308cfabd9dc35785ea9.java:863)
    at com.pegarules.generated.activity.ra_action_getnodeidtorun_a1695ca03cc81308cfabd9dc35785ea9.perform(ra_action_getnodeidtorun_a1695ca03cc81308cfabd9dc35785ea9.java:192)
    at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3505)
    at com.pega.pegarules.session.internal.mgmt.Executable.invokeActivity(Executable.java:10563)
    at com.pegarules.generated.activity.ra_action_pushdbindexes_8c63caf56bbf17baa0f39a6bc799a162.step3_circum0(ra_action_pushdbindexes_8c63caf56bbf17baa0f39a6bc799a162.java:635)
    at com.pegarules.generated.activity.ra_action_pushdbindexes_8c63caf56bbf17baa0f39a6bc799a162.perform(ra_action_pushdbindexes_8c63caf56bbf17baa0f39a6bc799a162.java:103)
    at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3505)



Steps to Reproduce



Not Applicable

Root Cause



A defect in Pegasystems’ code causing deadlock in batch requestors  like ruleusagesnapshot Thread depends on  pushdbindexes  Thread which is again depends on ruleusagesnapshot  thread. 


Resolution



Apply HFix-29337 to resolve the issue.

Published September 30, 2016 - Updated October 23, 2016

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.