https://issues.apache.org/bugzilla/show_bug.cgi?id=55200

            Bug ID: 55200
           Summary: [websocket] Problem writing many subsequent binary
                    messages
           Product: Tomcat 8
           Version: trunk
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: s.bos...@gmail.com

I see sometimes failing connections due to IOException (see below).
This happens when trying to send thousands of binary messages (1024 bytes each)
without any delay between the subsequent messages.

Having look at the code in AsyncChannelWrapperSecure$WriteTask.run(219), I
think it is not correct to assume that if not all of the bytes in the buffer
are written, this shall produce IOException. I think in this case, there shall
be an attempt to write the rest of the bytes in a cycle.


Here one exception I got during the test:
Exception is :java.io.IOException: java.util.concurrent.ExecutionException:
java.io.IOException: Only wrote [460] of [1,098] bytes
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:204)
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendBytes(WsRemoteEndpointImplBase.java:113)
    at
org.apache.tomcat.websocket.WsRemoteEndpointBasic.sendBinary(WsRemoteEndpointBasic.java:43)
    at WebsocketsTestManager$TestThread.run(WebsocketsTestManager.java:271)
Caused by: java.util.concurrent.ExecutionException: java.io.IOException: Only
wrote [460] of [1,098] bytes
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase$FutureToSendHandler.get(WsRemoteEndpointImplBase.java:729)
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:202)
    ... 3 more
Caused by: java.io.IOException: Only wrote [460] of [1,098] bytes
    at
org.apache.tomcat.websocket.AsyncChannelWrapperSecure$WriteTask.run(AsyncChannelWrapperSecure.java:220)
    at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:789)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to