Fix jetty context leak
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
@@ -34,6 +34,10 @@ public class ExecutorInstrumentationUtils {
// TODO Workaround for
// https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/787
&& !taskClass.getName().equals("org.apache.tomcat.util.net.NioEndpoint$SocketProcessor")
+ // Avoid context leak on jetty. Runnable submitted from SelectChannelEndPoint is used to
+ // process a new request which should not have context from them current request.
+ && (enclosingClass == null
+ || !enclosingClass.getName().equals("org.eclipse.jetty.io.nio.SelectChannelEndPoint"))
// Don't instrument the executor's own runnables. These runnables may never return until
// netty shuts down.
&& (enclosingClass == null

Fix jetty context leak (#1966)