This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Kill server instance when 'Thread Pool Stuck Thread' is detected

 
Javian Berts
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to shutdown my server instance whenever a thread is detected to be stuck for a period of time so that my nodemanager could bring it up again. How do I come about doing that?

Thanks in advance.

Javian
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Technically you could do that by looking up a thread related MBean and restarting the server when your program detects that there are stuck threads.

However the right approach would be to figure out why the threads are 'STUCK' in the first place
 
sudipto shekhar
Ranch Hand
Posts: 823
Chrome Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can guide the server to restart the server when the number of stuck threads exceeds a particular limit.

check the admin console for the same!

I did this using the node manager, and it worked!
 
Javian Berts
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

Thanks for all your input. Really appreciate it.

Sudipto, are you using the workmanager to do so? I am following the steps listed on:

http://download.oracle.com/docs/cd/E15523_01/web.1111/e13701/self_tuned.htm


However, I am not sure where to place this segment:

<work-manager>
<name>stuckthread_workmanager</name>
<work-manager-shutdown-trigger>
<max-stuck-thread-time>30</max-stuck-thread-time>
<stuck-thread-count>2</stuck-thread-count>
</work-manager-shutdown-trigger>
</work-manager>

in the config.xml. Any idea where I should put it? Thanks again.
 
sudipto shekhar
Ranch Hand
Posts: 823
Chrome Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Mr. Berts,

I found out something for you.

Refer to this ; might help.

Good luck
 
Javian Berts
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will check it out. Thanks, Sudipto.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic