tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton Piatek1 <>
Subject websockets holding on to threads.
Date Fri, 05 Apr 2013 13:07:02 GMT
I am seeing what at first appears to be a bug, but given the lack of other 
reports I can't believe I am the only person seeing this, so maybe it is 

I have tomcat (was 7.0.30, but I just tried with 7.0.39) running a website 
which uses websockets. The websockets code in tomcat isn't that 
complicated - My servlet returns a new subclass of StreamInbound which has 
overridden the onTextData() and onBinaryData() methods. This seems to 
generally work fine, and I can send and receive data happily.

However when I load up several browser windows I find that tomcat hangs. I 
used jconsole to check the tomcat threads and found that as I open each 
new websocket, the tomcat worker threads go from idle threads waiting for 
work to the following busy, blocking threads waiting for websocket data.

Name: http-bio-4415-exec-5
Total blocked: 50  Total waited: 112

Stack trace: Method)
   - locked

I am trying to figure out what I am missing. I didn't think I needed to 
override StreamInbound.onData() in my class, but as that seems to be what 
is keeping the thread busy, presumably waiting for data looking at that 

Am I misunderstanding something, or is this possibly a tomcat bug?
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message