You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/11/25 02:17:35 UTC

[GitHub] [dubbo] CrazyHZM commented on a diff in pull request #11012: Fixed metrics collection getting wrong method name when generalize called

CrazyHZM commented on code in PR #11012:
URL: https://github.com/apache/dubbo/pull/11012#discussion_r1031952663


##########
dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/metrics/filter/MetricsCollectExecutor.java:
##########
@@ -88,6 +90,10 @@ private void endExecute(Supplier<Boolean> rtStat){
     private void init(Invocation invocation) {
         String serviceUniqueName = invocation.getTargetServiceUniqueName();
         String methodName = invocation.getMethodName();
+        if (invocation instanceof RpcInvocation &&
+            isGenericCall(((RpcInvocation) invocation).getParameterTypesDesc(), methodName)) {
+            methodName = (String) invocation.getArguments()[0];

Review Comment:
   Check the length of the Arguments array to prevent out-of-bounds index addresses.



-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org