How to configure stuck thread handling for only one new restful web service?

1.4k Views Asked by At

I'm developing a restful web service which is supposed to return huge files (2GB or larger). The execution of this web service will of course take time. When testing it with several parallel downloads, the WLS throws the BEA-000337 error (the download takes more time than "Stuck Thread Max Time" is set to in the server configuration).

My problem is that I can't find a way to adjust it only for the new web service. The "Stuck Thread Max Time" setting is set at the server level, meaning it will affect all other services. This is not acceptable. I need a way to set this only for the new service.

It seems that I should be able to use own defined WorkManagers, but the only configuration options I can find in the documentation for WorkManagers deals with the handling of stuck threads and not how to recognize if a thread is stuck.

My question is:

Is there a way to configure in wls, only for this new web service, how it should recognize stuck threads and how it should handle these threads?

The WLS version I am using is 10.3.6

2

There are 2 best solutions below

0
On

Your processing takes time and default setting of StuckThreadMaxTime is set to 600 seconds, you will see such errors in logs.

You can set StuckThreadMaxTime with bigger value (its located on weblogic console in: domain > Environment > Servers > Admin Server > Configuration/Tuning)

0
On

Weblogic is an application server for javaEE applications, and one of the features that make application servers attractive is that they act as containers handling a lot of stuff that otherwise should be done programmatically. One of them il thread management. So among EJB restrictions you can find:

-create or manage threads

-use thread synchronization primitives to synchronize access with other enterprise bean instances

This is because thread handling is up to the container. In weblogic console you can configure the "Stuck Thread Max Time" parameter per single managed server (Configuration > Tuning tab) changing the default value of 600 seconds. Anyway remember that when thread processing exceeds 600 seconds you get an error on the logs because Weblogic simply classifies the thread as stuck, but processing goes on, and the thread might finally get unstuck when processing ends.

This might be useful:

https://docs.oracle.com/cd/E84527_01/wls/WLACH/taskhelp/tuning/TuningExecuteThreads.html