zabetak commented on code in PR #334:
URL: https://github.com/apache/tez/pull/334#discussion_r1477969135
##########
tez-plugins/tez-protobuf-history-plugin/src/main/java/org/apache/tez/dag/history/logging/proto/ProtoMessageWritable.java:
##########
@@ -96,6 +96,9 @@ public void readFields(DataInput in) throws IOException {
cin = CodedInputStream.newInstance(din);
cin.setSizeLimit(Integer.MAX_VALUE);
}
+ if (din.in != in) {
+ cin.resetSizeCounter();
+ }
Review Comment:
The javadoc of `CodedInputStream#setSizeLimit` says the following:
```
If you want to read several messages from a single CodedInputStream, you
could call resetSizeCounter() after each one to avoid hitting the size limit.
```
Based on that I would be inclined to reset the counter after every single
message otherwise it still seems feasible to hit the same error if the
`DataInput` is sufficiently large.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]