garbled data passed in cumulation buffer for decode(), probably when data re-transmission.
huican ping
pinghuican at gmail.com
Thu Sep 10 14:31:33 EDT 2009
FYI, my decoder inherited from the FrameDecoder.
Thanks
Huican Ping
On Thu, Sep 10, 2009 at 1:23 PM, Huican Ping <pinghuican at gmail.com> wrote:
>
> Hello Trustin,
>
> I have a protocl based on tcp and will read-in data which was wrapped with
> startBlockByte and endBlockByte+TrailingCR.
>
> The coming wrapped data is 1065 bytes. And I am using the default default
> socket buffer size, so I think it is 1024 byte. With 1065 bytes input from
> client, I think netty needs 2 reads for the socket.
>
> At some very rare time under heavy TPS, when my decode parser tries to
> decode() the buffer passed in, and I noticed that data is garbled.
>
> Below are two failures observed:
> 1:) I noticed that The first failed one and 2nd failed part combines into
> a whole message.
> 2:) Those two failures happened about 1 minute interval.
> 3:) I also noticed that the first part is exactly 1024byte which is same
> as socket buffer.
> The coming data has 1065 bytes, and socket buffer size is 1024.
>
> It happens very rare and with high TPS. I think probably when netty code (or
> somewhere) doesn’t correctly construct the final buffer to all the incoming
> date from 2 times socket reads in the case of data retransmission.
>
> Can you please check that?
> <body>
> <infoMsg>ReceiveTimeout while got partial received message from
> channel=963160213, bytes=1065, readerIndex=0, writerIndex=1065, byte at
> readerIndex=60, byte at writerIndex-1=0, decoderState=MSG_START_FOUND,
> content=<?xml version="1.0"?>
> <!--* po1.xml, from
> http://www.w3.org/TR/xmlschema-0/#UnqualLocals *-->
> <!--* Retrieved *-->
> <!--* Expanded to be a complete document by MSM *-->
>
> <apo:purchaseOrder
> xmlns:apo="http://www.example.com/PO1"
> orderDate="1999-10-21">
> <shipTo country="US">
> <name>Alice Smith</name>
> <street>123 Maple Street</street>
> <!-- etc. -->
> <city>Mill Valley</city>
> <state>CA</state>
> <zip>90952</zip>
> </shipTo>
> <billTo country="US">
> <name>Robert Smith</name>
> <street>8 Oak Avenue</street>
> <!-- etc. -->
> <city>Old Town</city>
> <state>PA</state>
> <zip>95819</zip>
> </billTo>
> <apo:comment>Hurry, my lawn is going
> wild!</apo:comment>
> <items>
> <item partNum="926-AA">
> <productName>Baby Monitor</productName>
> <quantity>1</quantity>
> <USPrice>39.98</USPrice>
> <shipDate>1999-05-21</shipDate>
> </ite..........................................</infoMsg>
> </body>
> <body>
> <infoMsg>No new data received in 30,000 milliseconds, closing the
> channel
> com.acme.utils.ReceiveTimeoutException: No new data received in
> 30,000 milliseconds, closing the channel
> at
> com.acme.utils.ReceiveTimeoutHandler.readTimedOut(ReceiveTimeoutHandler.java:38)
> at
> org.jboss.netty.handler.timeout.ReadTimeoutHandler$ReadTimeoutTask.run(ReadTimeoutHandler.java:196)
> at
> org.jboss.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:506)
> at
> org.jboss.netty.util.HashedWheelTimer$Worker.notifyExpiredTimeouts(HashedWheelTimer.java:421)
> at
> org.jboss.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:371)
> at java.lang.Thread.run(Thread.java:619)
> </infoMsg>
> </body>
>
> <body>
> <infoMsg>read date into WritableMessage size=1064
> content=................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................m>
> </items>
> </apo:purchaseOrder>
> </infoMsg>
> </body>
> <body>
> <infoMsg>bad message received. Found EndBlockChar, but Missing
> startBlockCharacter.</infoMsg>
>
> --
> View this message in context: http://n2.nabble.com/garbled-data-passed-in-cumulation-buffer-for-decode-probably-when-data-re-transmission-tp3618321p3618321.html
> Sent from the Netty User Group mailing list archive at Nabble.com.
>
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>
More information about the netty-users
mailing list