diff --git a/apm-sniffer/apm-sdk-plugin/httpasyncclient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpasyncclient/v4/LeaseRequestCompletedInterceptor.java b/apm-sniffer/apm-sdk-plugin/httpasyncclient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpasyncclient/v4/LeaseRequestCompletedInterceptor.java index 8b4bdc80c..61dd2df4e 100644 --- a/apm-sniffer/apm-sdk-plugin/httpasyncclient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpasyncclient/v4/LeaseRequestCompletedInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/httpasyncclient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpasyncclient/v4/LeaseRequestCompletedInterceptor.java @@ -37,6 +37,7 @@ public class LeaseRequestCompletedInterceptor implements InstanceMethodsAroundIn conn.getContext().setAttribute(Constants.SKYWALKING_CONTEXT_SNAPSHOT, ContextManager.capture()); conn.getContext().setAttribute(Constants.SKYWALKING_HTTP_CONTEXT, Constants.HTTP_CONTEXT_LOCAL.get()); } + Constants.HTTP_CONTEXT_LOCAL.remove(); } @Override diff --git a/changes/changes-8.8.0.md b/changes/changes-8.8.0.md index 52021e47a..c61880178 100644 --- a/changes/changes-8.8.0.md +++ b/changes/changes-8.8.0.md @@ -40,6 +40,7 @@ Release Notes. * Add plugin to support okhttp 2.x * Optimize okhttp 3.x 4.x plugin to get span time cost precisely * Adapt message header properties of RocketMQ 4.9.x +* Fix httpasyncclient-4.x-plugin's memory leak risk #### Documentation