hi,
Reviving an old thread here. We continue to see the same failures periodically (e.g. 2 of 10 times) on the CI server only, never locally.
In response to Joakim's comment below that "an extra frame arrived after the supposed last frame of the last message" based on actual logging I'm wondering if there couldn't be a potential concurrency issue?
See for example these two log statements that correspond to two WebSocket messages in the same session (the only session in the test) processed at nearly (and possibly) the same time in two different threads:
06:43:13,160 [WebSocketClient@1545468091-533] - Processing SockJS open frame in WebSocketClientSockJsSession[id='b61c4e070bc4e81c83801f2fbe6a27e2, url="" href="http://localhost:53793/test">http://localhost:53793/test]
...
06:43:13,161 [WebSocketClient@1545468091-536] - Unhandled Error (closing connection)
java.io.IOException: Cannot append to finished buffer
at org.eclipse.jetty.websocket.common.message.SimpleTextMessage.appendFrame(SimpleTextMessage.java:47)
at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.appendMessage(AbstractEventDriver.java:60)
at org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver.onTextFrame(JettyAnnotatedEventDriver.java:201)
at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:160)
at org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:309)
at org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:214)
at org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:220)
at org.eclipse.jetty.websocket.common.Parser.parse(Parser.java:258)
at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:613)
at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:468)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:626)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:546)
at java.lang.Thread.run(Thread.java:745)
One another example with a different error message but in the same part of the code:
17:33:30,200 [WebSocketClient@588756412-539] - Processing SockJS open frame in WebSocketClientSockJsSession[id='64344caa5fa655c02bd54982011f31be, url="" href="http://localhost:4113/test">http://localhost:4113/test]
...
17:33:30,201 [WebSocketClient@588756412-538] - Unhandled Error (closing connection)
java.io.IOException: Out of order Continuation frame encountered
at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.onContinuationFrame(AbstractEventDriver.java:194)
at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:165)
at org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:309)
at org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:214)
at org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:220)
at org.eclipse.jetty.websocket.common.Parser.parse(Parser.java:258)
at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:613)
at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:468)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:626)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:546)
at java.lang.Thread.run(Thread.java:745)
Is it possible that under some circumstances on the client side, two incoming WebSocket messages of the same session may not be processed sequentially? The QueuedThreadPool from the stack trace runs in a loop but the log messages are from different threads.
Any idea what else could possibly lead to the above errors? Also for what it's worth, the same tests parameterized to run with another WebSocket client do not have these failures.
Thanks,
Rossen