Sigma-Ma opened a new pull request, #8489:
URL: https://github.com/apache/hbase/pull/8489

   JIRA: https://issues.apache.org/jira/browse/HBASE-30092
   
   ### What changes were proposed in this pull request?
   
   This change avoids calling `Message.toString()` when 
`MonitoredRPCHandlerImpl` generates RPC monitoring information.
   
   For protobuf parameters, HBase now records only the protobuf message type, 
such as `ScanRequest`. The existing `packetlength` field continues to report 
the serialized request size.
   
   ### Why are the changes needed?
   
   HBASE-30092 reports that `MonitoredRPCHandlerImpl.generateCallInfoMap()` can 
cause an out-of-memory error while generating RegionServer heartbeat 
information for a large in-flight RPC request.
   
   Calling `toString()` on a protobuf recursively materializes the complete 
TextFormat representation. For large RPC requests, this creates a significant 
additional allocation in the monitoring path and can exhaust the RegionServer 
heap.
   
   Recording only the protobuf message type keeps monitoring allocation 
independent of the request payload size while preserving the RPC method and 
serialized packet length.
   
   ### How was this patch tested?
   
   Added a regression test to `TestTaskMonitor`, covering:
   
   - Cloning a monitored RPC containing a large protobuf `ScanRequest`.
   - The RPC parameters contain only the protobuf message type.
   - The serialized packet length is preserved.
   
   The focused unit test can be run with:
   
   ```bash
   mvn -pl hbase-server -am \
     -DskipITs \
     '-Dtest=TestTaskMonitor#testCloneDoesNotStringifyProtobufParams' \
     -Dsurefire.failIfNoSpecifiedTests=false \
     test


-- 
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]

Reply via email to