Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] "java.io.IOException: Cannot append to finished buffer" in SimpleTextMessage

What features of websocket are you using?
Interested in all features you use, client and server side.
Some features: binary and/or text messages, auto fragmentation, compression extensions, streaming, jsr-356 decoders/encoders, jsr-356 messagehandlers, etc ...


--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts


On Wed, Jul 2, 2014 at 12:50 PM, Rossen Stoyanchev <rstoyanchev@xxxxxxxxxxxxx> wrote:
Unfortunately I cannot reproduce it reliably. It's hard with concurrency issues like that.

I was hoping the stack trace might lead to some thoughts about what may be going on. Is there anything I could be doing incorrectly to lead to this exception? If not any other theories based on the stack trace? I could try to introduce a delay somewhere even in the Jetty code to get it to occur but could use some help to narrow it down.

Rosen


On Wed, Jul 2, 2014 at 3:27 PM, Joakim Erdfelt <joakim@xxxxxxxxxxx> wrote:
If you have a reproducible testcase we'd like to see it.
The exception is saying that the there was an extra frame (for a text message) that arrived after the supposed last frame of that same message.

--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts


On Wed, Jul 2, 2014 at 11:40 AM, Rossen Stoyanchev <rstoyanchev@xxxxxxxxxxxxx> wrote:
hi-

I have a simple unit test in which a Jetty WebSocketClient connects to a Jetty server and sends 100 messages in a loop that the server then echoes back. When all messages are received in the client, the test is complete. This runs okay most of the times except occasionally on our CI server there is a client-side failure after 40-50 messages that looks like this:

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:302)
        at org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:215)
        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:602)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:458)
        at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:534)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
        at java.lang.Thread.run(Thread.java:745)

From what I can see all server messages are processed sequentially (always the same Jetty thread) while client side messages are received in different threads. It is possible there is an issue with concurrency in the client?

Rossen



_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


Back to the top