Fix context leak on jetty
MODIFY
javaagent-api/src/main/java/io/opentelemetry/javaagent/instrumentation/api/concurrent/ExecutorInstrumentationUtils.java
javaagent-api/src/main/java/io/opentelemetry/javaagent/instrumentation/api/concurrent/ExecutorInstrumentationUtils.java
@@ -45,6 +45,13 @@ public class ExecutorInstrumentationUtils {
return false;
}
+ // HttpConnection implements Runnable. When async request is completed HttpConnection
+ // may be sent to process next request while context from previous request hasn't been
+ // cleared yet.
+ if (taskClass.getName().equals("org.eclipse.jetty.server.HttpConnection")) {
+ return false;
+ }
+
Class<?> enclosingClass = taskClass.getEnclosingClass();
if (enclosingClass != null) {
// Avoid context leak on jetty. Runnable submitted from SelectChannelEndPoint is used to

Fix context leak on jetty (#2920)