Fix jetty context leak
@@ -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
