2

I want to spot stuck threads (by setting StuckThreadMaxTime to monitor the continuous thread use) and given that each of the transactions are short running I want to set this to a low-ish value – say 20 seconds.

I suspect that the Continuous use counter is re-set as soon as the thread is returned to the pool (this would be logical) iven if the thread is re-used pretty much instantly. But I don’t know this for sure.

Does anyone know for sure that returning a thread to the pool will set the continuous use “clock” vs. the StuckThreadMaxTime even if the thread is in the pool for an undetectable small length of time?

Mat
  • 202,337
  • 40
  • 393
  • 406
Fratton-Ender
  • 21
  • 1
  • 1
  • 3

1 Answers1

3

I'm not sure what you mean by "Continuous use counter" but I can explain how Weblogic threads work and hopefully that will clarify your doubt.

Each incoming request is assigned one thread by WL. This thread will be utilized to complete the request and then returned to the thread pool.

What StuckThreadMaxTime does is to report that the thread has crossed that time limit for the same request.

So if it is set at default of 600 seconds, a message will be logged when that time is crossed.

Note - Weblogic does NOT clear that stuck thread after 600 seconds, it will continue the processing for as long as it needs. It merely notes this event in the log.

Finally when the request is completed, the thread is available for the next request. You can verify how many requests each thread has completed by viewing in the Admin console

Servers > Monitoring > Threads will show the number of threads and how many completed requests

So to come back to your exact question - the StuckThreadMaxTime is reset for each request and not carried across over multiple requests

This timer starts at the time of the request, and not when the thread was returned to the pool.

You can verify this via thread dumps - if you get a StuckThread message for (say) Thread 7 but after few minutes you can see Thread 7 might have cleared and is now serving another request.

Further Reading:

WebLogic stuck thread protection

Community
  • 1
  • 1
JoseK
  • 31,141
  • 14
  • 104
  • 131