Search code examples
javamultithreadingtomcatjboss

Tomcat - Timeout to release http thread


Let's assume I have deployed on a JBoss/Tomcat server a stupid service that just makes a Thread.sleep() (or somehow falls into a deadlock situation).

If this service receives enough incoming requests, all http threads eventually get stuck forever, and the server won't be able to process any other request until it is restarted.

Is there any timeout mecanism at JBoss/Tomcat level that would release/kill/recycle a http thread if the request processing is longer than a given delay, so that it can handle new incoming requests?


Solution

  • Obviously there is no such built-in mechanism in Tomcat.

    And more generally, killing a java thread cannot be done without the thread's cooperation.