Tommy Stendahl created CASSJAVA-85:
--------------------------------------

             Summary: Failure to decode messages with both custom payload and 
warnings in 3.x
                 Key: CASSJAVA-85
                 URL: https://issues.apache.org/jira/browse/CASSJAVA-85
             Project: Apache Cassandra Java driver
          Issue Type: Bug
            Reporter: Tommy Stendahl
            Assignee: Tommy Stendahl


We have reproduced the message decoding bug in java-driver 3.x. We found in 
java-driver 4.x and reported it as CASSJAVA-70.
Its the same issue, custom payload is decoded before warnings but the protocol 
specification have them on the opposite order.
{noformat}
Caused by: java.lang.IndexOutOfBoundsException: readerIndex(82) + length(65553) 
exceeds writerIndex(109): 
AbstractPooledDerivedByteBuf$PooledNonRetainedSlicedByteBuf(ridx: 82, widx: 
109, cap: 109/109, unwrapped: PooledUnsafeDirectByteBuf(ridx: 128, widx: 128, 
cap: 157))
  at 
io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1477)
  at 
io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1463)
  at io.netty.buffer.AbstractByteBuf.readSlice(AbstractByteBuf.java:880)
  at com.datastax.driver.core.CBUtil.readValue(CBUtil.java:229)
  at com.datastax.driver.core.CBUtil.readBytesMap(CBUtil.java:127)
  at com.datastax.driver.core.Message$ProtocolDecoder.decode(Message.java:278)
  at com.datastax.driver.core.Message$ProtocolDecoder.decode(Message.java:268)
  at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88)
  ... 39 common frames omitted{noformat}
The issue is in Message.java, Deconing warings are done on line 289-291, that 
should be done before line 279. 
https://github.com/apache/cassandra-java-driver/blob/e957cd2be4e771f499df23334197d5ee4577fad6/driver-core/src/main/java/com/datastax/driver/core/Message.java#L279



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to