rmdmattingly commented on code in PR #5481:
URL: https://github.com/apache/hbase/pull/5481#discussion_r1383448371


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/namequeues/RpcLogDetails.java:
##########
@@ -60,6 +64,18 @@ public RpcLogDetails(RpcCall rpcCall, Message param, String 
clientAddress, long
     // would result in corrupted attributes
     this.connectionAttributes = rpcCall.getConnectionAttributes();
     this.requestAttributes = rpcCall.getRequestAttributes();
+
+    // We also need to deep copy the message because the CodedInputStream may 
be
+    // overwritten before this slow log is consumed. Such overwriting could
+    // cause the slow log payload to be corrupt
+    try {
+      this.param = 
param.newBuilderForType().mergeFrom(param.toByteArray()).build();
+    } catch (InvalidProtocolBufferException e) {
+      LOG.error("Failed to parse protobuf for message {}", param, e);
+      if (this.param == null) {

Review Comment:
   yeah, I can't imagine when it wouldn't be true so maybe we should just 
remove this



-- 
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: issues-unsubscr...@hbase.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to