[
https://issues.jboss.org/browse/ISPN-7556?page=com.atlassian.jira.plugin....
]
Dan Berindei commented on ISPN-7556:
------------------------------------
Two more related problems:
1. {{Decoder2x.customReadKey}} doesn't have a {{break}} after the {{ITERATION_START}}
switch case, so if the buffer doesn't have all the iteration start parameters it will
continue reading the (shorter) iteration stop parameters. The iteration stop
{{operationDecodeContext}} is a {{String}}, not a {{IterationStartRequest}}, so this
causes a {{ClassCastException}} in {{ContextHandler.realRead()}}.
2. {{ExtendedByteBuf.readMaybeOptRangedBytes()}} returns an {{Optional(Optional.empty())}}
instead of an {{Optional.empty()}} when it can read the range length, but not the range
bytes. The caller then assumes that the range had negative length and doesn't retry
decoding when more data becomes available.
Decoder2x.readOptionalParams should not call markReaderIndex()
--------------------------------------------------------------
Key: ISPN-7556
URL:
https://issues.jboss.org/browse/ISPN-7556
Project: Infinispan
Issue Type: Bug
Components: Server
Affects Versions: 9.0.0.CR2
Reporter: Dan Berindei
Assignee: Dan Berindei
Fix For: 9.0.0.Final
{{Decoder2x.readOptionalParams()}} calls {{buffer.markReaderIndex()}} after reading each
parameter, but doesn't save the parameters anywhere. That means if the buffer
doesn't contain all the parameters, the decode pass ends unsuccessfully, and the next
decode pass doesn't see the parameters read by the previous pass.
Higher-level methods like {{Decoder2x.readMaybeNamedFactory()}} also call
{{readOptionalParams()}} without saving their own state first, meaning their state can be
lost as well.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)