Repository: impala
Updated Branches:
  refs/heads/master f9971f81a -> b0d3433e3

KUDU-2296: Fix deserialization of messages larger than 64MB

Protobuf's CodedInputStream has a 64MB total byte limit by
default. When trying to deserialize messages larger than
this, ParseMessage() hits this limit and mistakenly
think that the packet is too short. This issue is dormant
due to Kudu's default rpc_max_message_size of 50MB.
However, Impala will be using a larger value for
rpc_max_message_size and requires this fix.

The fix is to override the default 64MB limit by calling
CodedInputStream::SetTotalByteLimit() with the buffer's

Change-Id: I57d3f3ca6ec0aa8be0e67e6a13c4b560c9d2c63a
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <>
Reviewed-by: Joe McDonnell <>
Tested-by: Impala Public Jenkins


Branch: refs/heads/master
Commit: d7f2ce10b4b77258640be3dfba3bee6cb5031555
Parents: f9971f8
Author: Joe McDonnell <>
Authored: Tue Feb 13 14:43:19 2018 -0800
Committer: Impala Public Jenkins <>
Committed: Wed Feb 14 03:01:59 2018 +0000

 be/src/kudu/rpc/ | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/be/src/kudu/rpc/ b/be/src/kudu/rpc/
index dbb0fc5..fbc05bc 100644
--- a/be/src/kudu/rpc/
+++ b/be/src/kudu/rpc/
@@ -114,6 +114,10 @@ Status ParseMessage(const Slice& buf,
     << "Got mis-sized buffer: " << KUDU_REDACT(buf.ToDebugString());
   CodedInputStream in(, buf.size());
+  // Protobuf enforces a 64MB total bytes limit on CodedInputStream by default.
+  // Override this default with the actual size of the buffer to allow messages
+  // larger than 64MB.
+  in.SetTotalBytesLimit(buf.size(), -1);
   uint32_t header_len;

Reply via email to