From d71e95c611dbbf94353f3c4066f8df8f31757bb6 Mon Sep 17 00:00:00 2001 From: Carpenter Lee Date: Thu, 8 Nov 2018 17:52:52 +0800 Subject: [PATCH] Remove ContextUtil.enter() in client/consumer side --- .../csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilter.java | 2 -- .../sentinel/adapter/grpc/SentinelGrpcClientInterceptor.java | 2 -- 2 files changed, 4 deletions(-) diff --git a/sentinel-adapter/sentinel-dubbo-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilter.java b/sentinel-adapter/sentinel-dubbo-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilter.java index 85b268d8..54e067ba 100755 --- a/sentinel-adapter/sentinel-dubbo-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilter.java +++ b/sentinel-adapter/sentinel-dubbo-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilter.java @@ -54,7 +54,6 @@ public class SentinelDubboConsumerFilter extends AbstractDubboFilter implements Entry methodEntry = null; try { String resourceName = getResourceName(invoker, invocation); - ContextUtil.enter(resourceName); interfaceEntry = SphU.entry(invoker.getInterface().getName(), EntryType.OUT); methodEntry = SphU.entry(resourceName, EntryType.OUT); @@ -76,7 +75,6 @@ public class SentinelDubboConsumerFilter extends AbstractDubboFilter implements if (interfaceEntry != null) { interfaceEntry.exit(); } - ContextUtil.exit(); } } } diff --git a/sentinel-adapter/sentinel-grpc-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/grpc/SentinelGrpcClientInterceptor.java b/sentinel-adapter/sentinel-grpc-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/grpc/SentinelGrpcClientInterceptor.java index 47771388..4e168627 100755 --- a/sentinel-adapter/sentinel-grpc-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/grpc/SentinelGrpcClientInterceptor.java +++ b/sentinel-adapter/sentinel-grpc-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/grpc/SentinelGrpcClientInterceptor.java @@ -68,7 +68,6 @@ public class SentinelGrpcClientInterceptor implements ClientInterceptor { String resourceName = methodDescriptor.getFullMethodName(); Entry entry = null; try { - ContextUtil.enter(resourceName); entry = SphU.entry(resourceName, EntryType.OUT); // Allow access, forward the call. return new ForwardingClientCall.SimpleForwardingClientCall( @@ -131,7 +130,6 @@ public class SentinelGrpcClientInterceptor implements ClientInterceptor { if (entry != null) { entry.exit(); } - ContextUtil.exit(); } }