[
https://issues.apache.org/jira/browse/HBASE-28101?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Duo Zhang reopened HBASE-28101:
-------------------------------
Reopen as we found some problems on the PR.
See HBASE-28106
> Should check the return value of protobuf Message.mergeDelimitedFrom
> --------------------------------------------------------------------
>
> Key: HBASE-28101
> URL: https://issues.apache.org/jira/browse/HBASE-28101
> Project: HBase
> Issue Type: Bug
> Components: Protobufs, rpc
> Reporter: Duo Zhang
> Assignee: Duo Zhang
> Priority: Critical
> Fix For: 2.6.0, 2.4.18, 2.5.6, 3.0.0-beta-1
>
>
> Found this problem while upgrading thirdparty dependencies.
> The javadoc of mergeDelimitedFrom says
> {code}
> /**
> * Like {@link #mergeFrom(InputStream)}, but does not read until EOF.
> Instead, the size of the
> * message (encoded as a varint) is read first, then the message data.
> Use {@link
> * MessageLite#writeDelimitedTo(OutputStream)} to write messages in this
> format.
> *
> * @return true if successful, or false if the stream is at EOF when the
> method starts. Any
> * other error (including reaching EOF during parsing) causes an
> exception to be thrown.
> * @throws InvalidProtocolBufferException the bytes read are not
> syntactically correct
> * according to the protobuf wire format specification. The data is
> corrupt, incomplete,
> * or was never a protobuf in the first place.
> * @throws IOException an I/O error reading from the stream
> */
> {code}
> So we should not ignore the return value, otherwise we may get an incomplete
> message.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)