Profile Image
Flavio Caetano Garcia

Web sockets originated from the Spring framework are waiting

Eventually the websockets are "Waiting" with the following error:
stackTrace:
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(java.base@11.0.12/Native Method)
- waiting on <no object reference available>
at java.lang.Object.wait(java.base@11.0.12/Object.java:328)
at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.awaitWritable(AbstractFramedStreamSinkChannel.java:289)
- waiting to re-lock in wait() <0x00000000fe09d750> (a java.lang.Object)
at org.xnio.channels.Channels.flushBlocking(Channels.java:64)
at io.undertow.websockets.jsr.WebSocketSessionRemoteEndpoint$BasicWebSocketSessionRemoteEndpoint.sendText(WebSocketSessionRemoteEndpoint.java:287)
at org.springframework.web.socket.adapter.standard.StandardWebSocketSession.sendTextMessage(StandardWebSocketSession.java:215)
at org.springframework.web.socket.adapter.AbstractWebSocketSession.sendMessage(AbstractWebSocketSession.java:106)
at org.springframework.web.socket.sockjs.transport.session.WebSocketServerSockJsSession.writeFrameInternal(WebSocketServerSockJsSession.java:224)
at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.writeFrame(AbstractSockJsSession.java:326)
at org.springframework.web.socket.sockjs.transport.session.WebSocketServerSockJsSession.sendMessageInternal(WebSocketServerSockJsSession.java:213)
at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.sendMessage(AbstractSockJsSession.java:170)
at org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator.tryFlushMessageBuffer(ConcurrentWebSocketSessionDecorator.java:171)
at org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator.sendMessage(ConcurrentWebSocketSessionDecorator.java:144)
at org.springframework.web.socket.messaging.StompSubProtocolHandler.sendToClient(StompSubProtocolHandler.java:482)
at org.springframework.web.socket.messaging.StompSubProtocolHandler.handleMessageToClient(StompSubProtocolHandler.java:469)
at org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.handleMessage(SubProtocolWebSocketHandler.java:366)
at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:144)
at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@11.0.12/ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@11.0.12/ThreadPoolExecutor.java:628)
at java.lang.Thread.run(java.base@11.0.12/Thread.java:829)
Locked ownable synchronizers:
<0x00000000fd560b48> (a java.util.concurrent.ThreadPoolExecutor$Worker)
<0x00000000fe093078> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)

 

This causes us to have to restart the server.



Report URL - https://fastthread.io/my-thread-report.jsp?p=c2hhcmVkLzIwMjEvMTEvMTIvLS1lc3RhbGVpcm8tZXhlYy50YXIuZ3otLTE3LTQ1LTc=

  • springframework

  • waitingstate

  • websockets

Please Sign In or to post your comment or answer

Profile Image

Ram Lakshmanan

Hello Flavio!

 

 Greetings.

 

 In the thread dump you had sent there are only 60 threads. In those 60 threads, only 3 of them are exhibhiting the WAITING pattern threads you have higlighted.

 

 If you keep your application running for a while, does this type of threads count gorws over a period? OR are they remaining static at this 3? Just 3 threads can't make application go unresponsive.

 

 These 3 threads are originated from the Spring framework and they are leveraging Jboss's XNIO library to make backend calls. Is there any problem/unresponsiveness in the backend applciations this thread connects to?  

 

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • springframework

  • waitingstate

  • websockets