Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

StaleThread error in logs

SA-5716

Summary



StaleThread error is observed in the logs

Error Messages



 ( mgmt.base.ThreadData) ERROR - Trying to use a recycled thread
com.pega.pegarules.pub.context.StaleThreadError: Thread has been recycled
at com.pega.pegarules.session.internal.mgmt.base.ThreadData.validateUse(ThreadData.java:575)
at com.pega.pegarules.session.internal.mgmt.PRThreadImpl.validateUse(PRThreadImpl.java:332)
at com.pega.pegarules.session.internal.mgmt.PRThreadImpl.getThreadFamilyName(PRThreadImpl.java:1665)
at com.pega.pegarules.session.internal.mgmt.base.RequestorPageDir.getFamilyPageMapForCurrentThread(RequestorPageDir.java:462)
...
at com.pega.pegarules.session.internal.mgmt.base.ThreadPassivation.configureThreadImpl(ThreadPassivation.java:243)
...
at com.pega.pegarules.session.internal.mgmt.base.RequestorThreadSync.getOrCreateThread(RequestorThreadSync.java:150)
at com.pega.pegarules.session.internal.mgmt.PRRequestorImpl.getOrCreateThread(PRRequestorImpl.java:662)
at com.pega.pegarules.monitor.internal.UsageDaemonImpl.snapshotOne(UsageDaemonImpl.java:1054)
at sun.reflect.GeneratedMethodAccessor421.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:1090)
at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:806)
at com.pega.pegarules.monitor.internal.UsageDaemonImpl.snapshotAllRequestors(UsageDaemonImpl.java:1018)
at com.pega.pegarules.monitor.internal.UsageDaemonImpl.processUsageData(UsageDaemonImpl.java:778)
...

( mgmt.base.ThreadData) ERROR - Trying to use a destroyed thread
com.pega.pegarules.pub.context.StaleThreadError: Thread has been destroyed
at com.pega.pegarules.session.internal.mgmt.base.ThreadData.validateUse(ThreadData.java:566)
at com.pega.pegarules.session.internal.mgmt.PRThreadImpl.validateUse(PRThreadImpl.java:332)
at com.pega.pegarules.session.internal.mgmt.PRThreadImpl.getThreadFamilyName(PRThreadImpl.java:1665)
at com.pega.pegarules.session.internal.mgmt.base.RequestorPageDir.getFamilyPageMapForCurrentThread(RequestorPageDir.java:462)
at com.pega.pegarules.session.internal.mgmt.base.RequestorPageDir.getPage(RequestorPageDir.java:262)
at com.pega.pegarules.session.internal.mgmt.base.RequestorPageDir.getPage(RequestorPageDir.java:219)
at com.pega.pegarules.session.internal.mgmt.base.RequestorPageDir.getRequestorPage(RequestorPageDir.java:277)
at com.pega.pegarules.session.internal.mgmt.PRRequestorImpl.getRequestorPage(PRRequestorImpl.java:1128)
at com.pega.pegarules.session.internal.mgmt.base.ThreadPassivation.configureThreadImpl(ThreadPassivation.java:243)
at com.pega.pegarules.session.internal.mgmt.PRThreadBase.configureThread(PRThreadBase.java:442)
at com.pega.pegarules.session.internal.mgmt.PRThreadImpl.<init>(PRThreadImpl.java:307)
at com.pega.pegarules.session.internal.mgmt.PRThreadImpl.acquire(PRThreadImpl.java:322)
at com.pega.pegarules.session.internal.mgmt.base.RequestorThreadSync.getOrCreateThread(RequestorThreadSync.java:171)
at com.pega.pegarules.session.internal.mgmt.base.RequestorThreadSync.getOrCreateThread(RequestorThreadSync.java:158)
at com.pega.pegarules.session.internal.mgmt.base.RequestorThreadSync.getOrCreateThread(RequestorThreadSync.java:154)
at com.pega.pegarules.session.internal.mgmt.base.RequestorThreadSync.getOrCreateThread(RequestorThreadSync.java:150)
at com.pega.pegarules.session.internal.mgmt.base.RequestorThreadSync.getOrCreateLastUsedThread(RequestorThreadSync.java:242)
at com.pega.pegarules.session.internal.mgmt.PRRequestorImpl.getOrCreateLastUsedThread(PRRequestorImpl.java:683)
at com.pega.pegarules.monitor.internal.PRMonRequestorStateImpl.takeUsageSnapshot(PRMonRequestorStateImpl.java:472)
at com.pega.pegarules.monitor.internal.PRMonRequestorStateImpl.takeUsageSnapshot(PRMonRequestorStateImpl.java:403)
at com.pega.pegarules.monitor.internal.UsageDaemonImpl.snapshotOne(UsageDaemonImpl.java:1055)
at sun.reflect.GeneratedMethodAccessor421.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:1090)
at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:806)
at com.pega.pegarules.monitor.internal.UsageDaemonImpl.snapshotAllRequestors(UsageDaemonImpl.java:1018)
at com.pega.pegarules.monitor.internal.UsageDaemonImpl.processUsageData(UsageDaemonImpl.java:778)
...


Steps to Reproduce



N/A


Root Cause



The root cause of this problem is a defect in Pegasystems’ code/rules. In
 usage daemon, while capturing usage data, avoid setting the last thread as processing thread while taking requestor lock. Thus avoiding usage of stale thread. Also, avoid repeated logging of stale thread error while creating a PRException object when exception occurs due to stale thread.


Resolution



This issue is resolved by hotfix item Hfix-20348,Hfix-6155

Published January 31, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

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

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us