Details
Description
Found this problem while upgrading thirdparty dependencies.
The javadoc of mergeDelimitedFrom says
/** * 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 */
So we should not ignore the return value, otherwise we may get an incomplete message.
Attachments
Issue Links
- relates to
-
HBASE-28106 TestShadeSaslAuthenticationProvider fails for branch-2.x
- Resolved
- links to