You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2013/07/05 16:27:48 UTC

[Bug 55200] New: [websocket] Problem writing many subsequent binary messages

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.boshev@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55200] [websocket] Problem writing many subsequent binary messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55200

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Thanks for the report. I agree with your analysis. I can't reproduce this but I
have implemented what I believe is an appropriate fix in trunk.

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

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