PrashantLearnIT
Giga Sage

Hi there, 

 

Explanation - 

 

A thread is the path taken when a program is executed. Generally, all programs have at least one thread that is provided by the JVM at the start of the program's execution.

 

Threads.do allows you to view stack traces for each currently running thread. It can be helpful to gather information on all running threads to determine the cause if a thread is running for a long time. Stats.do can be used to determine how long the thread has been running.

 

From stats.do, under the Semaphore Sets segment, you can find information regarding the semaphores available to the instance node. A semaphore is a count of threads that are permitted to access resources on the node. For example, if your apache-tomcat server is configured to permit N number of semaphores in total, that means that there are up to N threads that are authorized to access a resource at any one point in time.

 

In the example, an active thread, initiated from the Notification [sys_notification] table has been running for 8.465 seconds. Clicking the link allows you to further investigate the root cause of the issue.

5.jpg

 

Clicking the link to the thread displays the full stack trace. Searching for a scripting table, such as Business Rules [sys_script] or Script Includes [sys_script_include] or similar, with a sys_id may bring more clarity to the origin of the issue.

For example, in this stack trace, the Sys ID for the sys_script table is shown.

6.jpg

 

Threads may include the following text at the top of the stack trace:

  • Unsafe.park (Native Method): is an idle thread, like thread.wait
  • socketRead0 (Native Method): is used to read and receive data
  • Thread.sleep (Native Method): causes the current thread to suspend execution for a specified period

With this information, you can navigate to sys_script.list and search the Sys ID field for the value found in the stack trace, in order to target the problematic record.

7.jpg

 

 

If my content helped you in anyway, please mark this content as BOOKMARK, SUBSCRIBE & HELPFUL

 

Best Regards,

Prashant Kumar (LearnIT)

 

YouTube Channel LearnIT: https://www.youtube.com/@learnitwithprashant

Blog LearnIT: https://medium.com/@LearnITbyPrashant

Prashant Kumar LinkedIn: https://www.linkedin.com/in/learnitbyprashant/

ServiceNow Community Prashant Kumar - https://www.servicenow.com/community/user/viewprofilepage/user-id/19635