diff --git a/CHANGES.md b/CHANGES.md index 3bd66b56334382df4968eec944b199df8bc98aa0..d2094a6dfd0737e354768c721571f44a50f54981 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ Release Notes. * The operation name of quartz-scheduler plugin, has been changed as the `quartz-scheduler/${className}` format. * Fix jdk-http and okhttp-3.x plugin did not overwrite the old trace header. * Support collecting logs of log4j, log4j2, and logback in the tracing context with a new `logger-plugin`. +* Fix the unexpected RunningContext recreation in the Tomcat plugin. #### OAP-Backend * Make meter receiver support MAL. diff --git a/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/TomcatInvokeInterceptor.java b/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/TomcatInvokeInterceptor.java index 851dd4124a694f763c86eedafc9b8b4155a7441d..94772da1e87e7f1feccc39cf9e39cee274e56a89 100644 --- a/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/TomcatInvokeInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/TomcatInvokeInterceptor.java @@ -101,8 +101,8 @@ public class TomcatInvokeInterceptor implements InstanceMethodsAroundInterceptor if (!TomcatPluginConfig.Plugin.Tomcat.COLLECT_HTTP_PARAMS && span.isProfiling()) { collectHttpParam(request, span); } - ContextManager.stopSpan(); ContextManager.getRuntimeContext().remove(Constants.FORWARD_REQUEST_FLAG); + ContextManager.stopSpan(); return ret; }