From b10a5f9bbf74ba1322fb4869fbd6464fac97563c Mon Sep 17 00:00:00 2001 From: observeralone Date: Mon, 22 Jan 2024 14:14:22 +0800 Subject: [PATCH] fix: popConfig interceptor.after finally --- .../InterceptorPluginDecorator.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/com/megaease/easeagent/core/plugin/interceptor/InterceptorPluginDecorator.java b/core/src/main/java/com/megaease/easeagent/core/plugin/interceptor/InterceptorPluginDecorator.java index cbcd14ee..3a1f71d4 100644 --- a/core/src/main/java/com/megaease/easeagent/core/plugin/interceptor/InterceptorPluginDecorator.java +++ b/core/src/main/java/com/megaease/easeagent/core/plugin/interceptor/InterceptorPluginDecorator.java @@ -64,16 +64,18 @@ public void before(MethodInfo methodInfo, Context context) { public void after(MethodInfo methodInfo, Context context) { IPluginConfig cfg = context.getConfig(); InitializeContext innerContext = (InitializeContext) context; - - if (cfg == null || cfg.enabled() || cfg instanceof NoOpIPluginConfig) { - try { - this.interceptor.after(methodInfo, context); - } finally { - innerContext.popToBound(); - innerContext.popRetBound(); + try { + if (cfg == null || cfg.enabled() || cfg instanceof NoOpIPluginConfig) { + try { + this.interceptor.after(methodInfo, context); + } finally { + innerContext.popToBound(); + innerContext.popRetBound(); + } } + } finally { + innerContext.popConfig(); } - innerContext.popConfig(); } @Override