Fix apm-dubbo-2.7.x-plugin memory leak due to some Dubbo RpcExceptions. (#6432)
This commit is contained in:
parent
665a07cb0f
commit
8c3d1679e3
|
|
@ -14,6 +14,7 @@ Release Notes.
|
|||
* Fix ClassCastException of log4j gRPC reporter.
|
||||
* Fix NPE when Kafka reporter activated.
|
||||
* Enhance gRPC log appender to allow layout pattern.
|
||||
* Fix apm-dubbo-2.7.x-plugin memory leak due to some Dubbo RpcExceptions.
|
||||
|
||||
#### OAP-Backend
|
||||
* Allow user-defined `JAVA_OPTS` in the startup script.
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import org.apache.dubbo.rpc.Invocation;
|
|||
import org.apache.dubbo.rpc.Invoker;
|
||||
import org.apache.dubbo.rpc.Result;
|
||||
import org.apache.dubbo.rpc.RpcContext;
|
||||
import org.apache.dubbo.rpc.RpcException;
|
||||
import org.apache.skywalking.apm.agent.core.context.CarrierItem;
|
||||
import org.apache.skywalking.apm.agent.core.context.ContextCarrier;
|
||||
import org.apache.skywalking.apm.agent.core.context.ContextManager;
|
||||
|
|
@ -109,8 +110,12 @@ public class DubboInterceptor implements InstanceMethodsAroundInterceptor {
|
|||
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
|
||||
Object ret) throws Throwable {
|
||||
Result result = (Result) ret;
|
||||
if (result != null && result.getException() != null) {
|
||||
dealException(result.getException());
|
||||
try {
|
||||
if (result != null && result.getException() != null) {
|
||||
dealException(result.getException());
|
||||
}
|
||||
} catch (RpcException e) {
|
||||
dealException(e);
|
||||
}
|
||||
|
||||
ContextManager.stopSpan();
|
||||
|
|
|
|||
Loading…
Reference in New Issue