1 Reply Latest reply on Nov 22, 2017 7:44 AM by jaikiran pai

    Undertow hang up

    Vladimir Ilmov Newbie

      Hey, i am trying to get some advice regarding resolving stuff. Maybe its my issue but it seems it might be an issue with undertow. Need your advice.

       

      I am using spring-boot 1.5.7.RELEASE included with undertow-1.4.20.Final.

       

      Today my web server got stuck because of this.

       

      "SockJS-2" #29 prio=5 os_prio=0 tid=0x00006c6554013000 nid=0x61e3 in Object.wait() [0x00006c65691e9000]

         java.lang.Thread.State: WAITING (on object monitor)

              at java.lang.Object.wait(Native Method)

              - waiting on <0x00006c663efc6780> (a java.lang.Object)

              at java.lang.Object.wait(Object.java:502)

              at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.awaitWritable(AbstractFramedStreamSinkChannel.java:281)

              - locked <0x00006c663efc6780> (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:203)

              at org.springframework.web.socket.adapter.AbstractWebSocketSession.sendMessage(AbstractWebSocketSession.java:101)

              at org.springframework.web.socket.sockjs.transport.session.WebSocketServerSockJsSession.writeFrameInternal(WebSocketServerSockJsSession.java:220)

              at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.writeFrame(AbstractSockJsSession.java:318)

              at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.sendHeartbeat(AbstractSockJsSession.java:251)

              - locked <0x00006c663e506d18> (a java.lang.Object)

              at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession$HeartbeatTask.run(AbstractSockJsSession.java:455)

              - locked <0x00006c663e506d18> (a java.lang.Object)

              at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)

              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

              at java.util.concurrent.FutureTask.run(FutureTask.java:266)

              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)

              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

              at java.lang.Thread.run(Thread.java:745)

       

      "XNIO-3 I/O-4" #27 prio=5 os_prio=0 tid=0x00006c66588eb000 nid=0x61e1 waiting for monitor entry [0x00006c6569447000]

         java.lang.Thread.State: BLOCKED (on object monitor)

              at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.cancelHeartbeat(AbstractSockJsSession.java:277)

              - waiting to lock <0x00006c663e506d18> (a java.lang.Object)

              at org.springframework.web.socket.sockjs.transport.session.WebSocketServerSockJsSession.sendMessageInternal(WebSocketServerSockJsSession.java:209)

              at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.sendMessage(AbstractSockJsSession.java:162)

              at pro.deta.meeting.notification.LocalSpringWebSocketNotifier.notify(LocalSpringWebSocketNotifier.java:26)

              at pro.deta.meeting.repository.MeetingNotificationService.notify(MeetingNotificationService.java:50)

              - locked <0x00006c663dbbaf88> (a pro.deta.meeting.notification.LocalSpringWebSocketNotifier)

              at pro.deta.meeting.repository.MeetingNotificationService.notify(MeetingNotificationService.java:33)

              at pro.deta.meeting.repository.MeetingNotificationService.notify(MeetingNotificationService.java:28)

              at pro.deta.meeting.repository.MeetingNotificationService.notify(MeetingNotificationService.java:38)

              at pro.deta.meeting.session.MeetingManagerProcesor.processMessage(MeetingManagerProcesor.java:283)

              at pro.deta.meeting.session.MeetingManagerProcesor$$FastClassBySpringCGLIB$$1a364483.invoke(<generated>)

       

      Problem is simple: if someone trying to send message to a stuck web socket - it also stuck. I am not sure how to reproduce it, it happened once and i just take thread dumps and had to restart server.

       

      I am using web socket + sockjs

       

      It is looks similar as UNDERTOW-637 but this one claimed to be fixed already.

       

      Thanks!