How to kill a JBoss thread which is stuck reading from a socket
Issue
- Using the jmx-console I can see a thread that appears to be hung up for some reason.
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.read(SocketInputStream.java:129)
java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
java.io.BufferedInputStream.read(BufferedInputStream.java:317)
sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687)
sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1064)
java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
...
If this thread was just stuck there is there a way to kill it?
- How can I stop hung http threads ?
Due to a bug in Struts we are having problems with threads that go into an infinite loop. We have tracked down that the affected thread types are threads with names like "http-0.0.0.0-8080-XX". The long term solution is to upgrade Struts, but in the mean time we are trying to figure out a work around. Do you have any ideas how we could kill/restart the threads without bringing down the whole JBoss instance? We have found the HttpRequest instance in the jmx-console that currently are using the thread, but no good MBean options to use.
Environment
- JBoss Enterprise Application Platform (EAP)
- 5.x
- 4.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.