Github user linwen commented on a diff in the pull request: https://github.com/apache/incubator-hawq/pull/1377#discussion_r196996343 --- Diff: depends/libhdfs3/src/rpc/RpcChannel.cpp --- @@ -768,7 +771,15 @@ void RpcChannelImpl::readOneResponse(bool writeLock) { buffer.resize(headerSize); in->readFully(&buffer[0], headerSize, readTimeout); - if (!curRespHeader.ParseFromArray(&buffer[0], headerSize)) { + // use CodedInputStream around the buffer, so we can set TotalBytesLimit on it + ArrayInputStream ais(&buffer[0], headerSize); + CodedInputStream cis(&ais); + cis.SetTotalBytesLimit(maxLength, maxLength/2); + + // use ParseFromCodedStream instead of ParseFromArray, so it can consume the above CodedInputStream + // + // if just use ParseFromArray, we have on chance to set TotalBytesLimit (64MB default) --- End diff -- "on" should be "no"?
---