kezhenxu94 commented on a change in pull request #4187: make a suggestion about
DUBBO plugin
URL: https://github.com/apache/skywalking/pull/4187#discussion_r363594229
##########
File path:
apm-sniffer/apm-sdk-plugin/dubbo-plugin/src/main/java/org/apache/skywalking/apm/plugin/dubbo/DubboInterceptor.java
##########
@@ -56,6 +57,9 @@ public void beforeMethod(EnhancedInstance objInst, Method
method, Object[] allAr
Class<?>[] argumentsTypes, MethodInterceptResult result) throws
Throwable {
Invoker invoker = (Invoker)allArguments[0];
Invocation invocation = (Invocation)allArguments[1];
+ if
(invocation.getAttachments().containsKey(SW3CarrierItem.HEADER_NAME)) {
+ invocation.getAttachments().remove(SW3CarrierItem.HEADER_NAME);
+ }
Review comment:
> When dubbo retry, the parameter sw3 will not be updated.
@tzy1316106836 what @wu-sheng meant is that you should not simply use
`SW3CarrierItem.HEADER_NAME` as key to remove the context, you should use
something likeļ¼
```java
CarrierItem next = contextCarrier.items();
while (next.hasNext()) {
next = next.next();
rpcContext.getAttachments().remove(next.getHeadKey());
}
```
because there are chances that the users are using SkyWalking 6.x, which
uses protocol v2 and the key is `SW6CarrierItem.HEADER_NAME` instead of
`SW3CarrierItem.HEADER_NAME`, what's more, `SW3CarrierItem` will be removed soon
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services