Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [dinky admin] The page is stucked possibly because of websocket deadlock #4149

Open
3 tasks done
xiaobosu opened this issue Jan 15, 2025 · 3 comments · Fixed by #4160
Open
3 tasks done

[Bug] [dinky admin] The page is stucked possibly because of websocket deadlock #4149

xiaobosu opened this issue Jan 15, 2025 · 3 comments · Fixed by #4160
Assignees
Labels
Bug Something isn't working Waiting for reply Waiting for reply

Comments

@xiaobosu
Copy link

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

The whole site is stuck with no responding.

What you expected to happen

Many errors in the logs like this:

[dinky] 2025-01-14 18:44:31 CST ERROR org.dinky.ws.GlobalWebSocket 169 lambda$sendTopic$5 - Error sending sse data:UT000094: Blocking await method called from IO thread. Blocking IO must be dispatched to a worker thread or deadlocks will result.
[dinky] 2025-01-14 18:44:31 CST ERROR org.dinky.ws.GlobalWebSocket 169 lambda$sendTopic$5 - Error sending sse data:UT000094: Blocking await method called from IO thread. Blocking IO must be dispatched to a worker thread or deadlocks will result.
[dinky] 2025-01-14 19:02:08 CST ERROR org.dinky.ws.GlobalWebSocket 169 lambda$sendTopic$5 - Error sending sse data:null
[dinky] 2025-01-14 19:02:08 CST ERROR org.dinky.ws.GlobalWebSocket 169 lambda$sendTopic$5 - Error sending sse data:null

Dump:

"XNIO-1 I/O-3" #38 prio=5 os_prio=0 tid=0x00007f043fb2a800 nid=0x1ede in Object.wait() [0x00007f03ad5e9000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.awaitWritable(AbstractFramedStreamSinkChannel.java:329)
	- locked <0x000000077ed9aae8> (a java.lang.Object)
	at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.awaitWritable(AbstractFramedStreamSinkChannel.java:313)
	at io.undertow.websockets.core.WebSockets.sendBlockingInternal(WebSockets.java:1000)
	at io.undertow.websockets.core.WebSockets.sendBlockingInternal(WebSockets.java:986)
	at io.undertow.websockets.core.WebSockets.sendTextBlocking(WebSockets.java:200)
	at io.undertow.websockets.jsr.WebSocketSessionRemoteEndpoint$BasicWebSocketSessionRemoteEndpoint.sendText(WebSocketSessionRemoteEndpoint.java:258)
	at org.dinky.ws.GlobalWebSocket.lambda$sendTopic$5(GlobalWebSocket.java:166)
	at org.dinky.ws.GlobalWebSocket$$Lambda$1057/197355796.accept(Unknown Source)
	at java.util.concurrent.ConcurrentHashMap.forEach(ConcurrentHashMap.java:1597)
	at org.dinky.ws.GlobalWebSocket.sendTopic(GlobalWebSocket.java:160)
	at org.dinky.ws.GlobalWebSocket.lambda$firstSend$4(GlobalWebSocket.java:156)
	at org.dinky.ws.GlobalWebSocket$$Lambda$2026/1311504787.accept(Unknown Source)
	at java.util.HashMap.forEach(HashMap.java:1289)
	at org.dinky.ws.GlobalWebSocket.firstSend(GlobalWebSocket.java:155)
	at org.dinky.ws.GlobalWebSocket.onMessage(GlobalWebSocket.java:127)
	at sun.reflect.GeneratedMethodAccessor595.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at io.undertow.websockets.jsr.annotated.BoundMethod.invoke(BoundMethod.java:87)
	at io.undertow.websockets.jsr.annotated.AnnotatedEndpoint$2.onMessage(AnnotatedEndpoint.java:142)
	at io.undertow.websockets.jsr.FrameHandler$7.run(FrameHandler.java:288)
	at io.undertow.websockets.jsr.ServerWebSocketContainer$1.call(ServerWebSocketContainer.java:170)
	at io.undertow.websockets.jsr.ServerWebSocketContainer$1.call(ServerWebSocketContainer.java:167)
	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
	at io.undertow.websockets.jsr.ServerWebSocketContainer.invokeEndpointMethod(ServerWebSocketContainer.java:610)
	at io.undertow.websockets.jsr.ServerWebSocketContainer.invokeEndpointMethod(ServerWebSocketContainer.java:600)
	at io.undertow.websockets.jsr.FrameHandler.invokeTextHandler(FrameHandler.java:268)
	at io.undertow.websockets.jsr.FrameHandler.onFullTextMessage(FrameHandler.java:319)
	at io.undertow.websockets.core.AbstractReceiveListener$2.complete(AbstractReceiveListener.java:156)
	at io.undertow.websockets.core.AbstractReceiveListener$2.complete(AbstractReceiveListener.java:152)
	at io.undertow.websockets.core.BufferedTextMessage.read(BufferedTextMessage.java:105)
	at io.undertow.websockets.core.AbstractReceiveListener.readBufferedText(AbstractReceiveListener.java:152)
	at io.undertow.websockets.core.AbstractReceiveListener.bufferFullMessage(AbstractReceiveListener.java:90)
	at io.undertow.websockets.jsr.FrameHandler.onText(FrameHandler.java:184)
	at io.undertow.websockets.core.AbstractReceiveListener.handleEvent(AbstractReceiveListener.java:44)
	at io.undertow.websockets.core.AbstractReceiveListener.handleEvent(AbstractReceiveListener.java:33)
	at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
	at io.undertow.server.protocol.framed.AbstractFramedChannel$FrameReadListener.handleEvent(AbstractFramedChannel.java:974)
	at io.undertow.server.protocol.framed.AbstractFramedChannel$FrameReadListener.handleEvent(AbstractFramedChannel.java:954)
	at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
	at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
	at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89)
	at org.xnio.nio.WorkerThread.run(WorkerThread.java:591)

How to reproduce

open some page and work for a while.
use CDCSOURCE and read some jars by rs url

Anything else

I guess it's introduced by this pr: #3724

Version

1.2.0

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@xiaobosu xiaobosu added Bug Something isn't working Waiting for reply Waiting for reply labels Jan 15, 2025
Copy link

Hello @xiaobosu, this issue is about web, so I assign it to @Zzm0809. If you have any questions, you can comment and reply.

你好 @xiaobosu, 这个 issue 是关于 web 的,所以我把它分配给了 @Zzm0809。如有任何问题,可以评论回复。

@xiaobosu xiaobosu changed the title [Bug] [dinky admin] The page is stuck possibly because of websocket deadlock [Bug] [dinky admin] The page is stucked possibly because of websocket deadlock Jan 15, 2025
@mobivatrix
Copy link

if you check the server connection, you will find all new created socket connections

  1. check reconnect in UseWebSocketModel.tsx
  2. just in login page without logining, check websocket
  3. when logout, the connection may not be closed

@MactavishCui
Copy link
Contributor

MactavishCui commented Jan 17, 2025

I'll submit a PR to fix this bug today or tomorrow. This problem will be solved in release 1.2.1. Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Waiting for reply Waiting for reply
Projects
None yet
4 participants