diff --git a/scenarios/skywalking-agent/plugins/apm-caliban-v2x-plugin-0.3.0-SNAPSHOT.jar b/scenarios/skywalking-agent/plugins/apm-caliban-v2x-plugin-0.2.0-beta2.jar similarity index 91% rename from scenarios/skywalking-agent/plugins/apm-caliban-v2x-plugin-0.3.0-SNAPSHOT.jar rename to scenarios/skywalking-agent/plugins/apm-caliban-v2x-plugin-0.2.0-beta2.jar index d848548..5efe332 100644 Binary files a/scenarios/skywalking-agent/plugins/apm-caliban-v2x-plugin-0.3.0-SNAPSHOT.jar and b/scenarios/skywalking-agent/plugins/apm-caliban-v2x-plugin-0.2.0-beta2.jar differ diff --git a/scenarios/skywalking-agent/plugins/apm-cats-effect-v3x-plugin-0.3.0-SNAPSHOT.jar b/scenarios/skywalking-agent/plugins/apm-cats-effect-v3x-plugin-0.2.0-beta2.jar similarity index 88% rename from scenarios/skywalking-agent/plugins/apm-cats-effect-v3x-plugin-0.3.0-SNAPSHOT.jar rename to scenarios/skywalking-agent/plugins/apm-cats-effect-v3x-plugin-0.2.0-beta2.jar index 09945c7..4fb9dfb 100644 Binary files a/scenarios/skywalking-agent/plugins/apm-cats-effect-v3x-plugin-0.3.0-SNAPSHOT.jar and b/scenarios/skywalking-agent/plugins/apm-cats-effect-v3x-plugin-0.2.0-beta2.jar differ diff --git a/scenarios/skywalking-agent/plugins/apm-executors-plugin-0.3.0-SNAPSHOT.jar b/scenarios/skywalking-agent/plugins/apm-executors-plugin-0.2.0-beta2.jar similarity index 87% rename from scenarios/skywalking-agent/plugins/apm-executors-plugin-0.3.0-SNAPSHOT.jar rename to scenarios/skywalking-agent/plugins/apm-executors-plugin-0.2.0-beta2.jar index ae770c6..23fe095 100644 Binary files a/scenarios/skywalking-agent/plugins/apm-executors-plugin-0.3.0-SNAPSHOT.jar and b/scenarios/skywalking-agent/plugins/apm-executors-plugin-0.2.0-beta2.jar differ diff --git a/scenarios/skywalking-agent/plugins/apm-zio-v2x-plugin-0.3.0-SNAPSHOT.jar b/scenarios/skywalking-agent/plugins/apm-zio-v2x-plugin-0.2.0-beta2.jar similarity index 74% rename from scenarios/skywalking-agent/plugins/apm-zio-v2x-plugin-0.3.0-SNAPSHOT.jar rename to scenarios/skywalking-agent/plugins/apm-zio-v2x-plugin-0.2.0-beta2.jar index 7d58ed4..8f6dd7f 100644 Binary files a/scenarios/skywalking-agent/plugins/apm-zio-v2x-plugin-0.3.0-SNAPSHOT.jar and b/scenarios/skywalking-agent/plugins/apm-zio-v2x-plugin-0.2.0-beta2.jar differ diff --git a/scenarios/skywalking-agent/plugins/apm-ziocache-plugin-0.3.0-SNAPSHOT.jar b/scenarios/skywalking-agent/plugins/apm-ziocache-plugin-0.2.0-beta2.jar similarity index 88% rename from scenarios/skywalking-agent/plugins/apm-ziocache-plugin-0.3.0-SNAPSHOT.jar rename to scenarios/skywalking-agent/plugins/apm-ziocache-plugin-0.2.0-beta2.jar index c5847d7..2fa6f77 100644 Binary files a/scenarios/skywalking-agent/plugins/apm-ziocache-plugin-0.3.0-SNAPSHOT.jar and b/scenarios/skywalking-agent/plugins/apm-ziocache-plugin-0.2.0-beta2.jar differ diff --git a/scenarios/skywalking-agent/plugins/apm-ziogrpc-v06rcx-plugin-0.3.0-SNAPSHOT.jar b/scenarios/skywalking-agent/plugins/apm-ziogrpc-v06rcx-plugin-0.2.0-beta2.jar similarity index 93% rename from scenarios/skywalking-agent/plugins/apm-ziogrpc-v06rcx-plugin-0.3.0-SNAPSHOT.jar rename to scenarios/skywalking-agent/plugins/apm-ziogrpc-v06rcx-plugin-0.2.0-beta2.jar index bf0d338..4e42f4b 100644 Binary files a/scenarios/skywalking-agent/plugins/apm-ziogrpc-v06rcx-plugin-0.3.0-SNAPSHOT.jar and b/scenarios/skywalking-agent/plugins/apm-ziogrpc-v06rcx-plugin-0.2.0-beta2.jar differ diff --git a/scenarios/skywalking-agent/plugins/apm-ziohttp-v2x-plugin-0.3.0-SNAPSHOT.jar b/scenarios/skywalking-agent/plugins/apm-ziohttp-v2x-plugin-0.2.0-beta2.jar similarity index 89% rename from scenarios/skywalking-agent/plugins/apm-ziohttp-v2x-plugin-0.3.0-SNAPSHOT.jar rename to scenarios/skywalking-agent/plugins/apm-ziohttp-v2x-plugin-0.2.0-beta2.jar index aeb1633..57f0cc7 100644 Binary files a/scenarios/skywalking-agent/plugins/apm-ziohttp-v2x-plugin-0.3.0-SNAPSHOT.jar and b/scenarios/skywalking-agent/plugins/apm-ziohttp-v2x-plugin-0.2.0-beta2.jar differ diff --git a/shared/plugin-common/src/main/scala/org/bitlap/skywalking/apm/plugin/common/ThreadPoolExecutorWrapper.scala b/shared/plugin-common/src/main/scala/org/bitlap/skywalking/apm/plugin/common/ThreadPoolExecutorWrapper.scala deleted file mode 100644 index 05c4447..0000000 --- a/shared/plugin-common/src/main/scala/org/bitlap/skywalking/apm/plugin/common/ThreadPoolExecutorWrapper.scala +++ /dev/null @@ -1,30 +0,0 @@ -package org.bitlap.skywalking.apm.plugin.common - -import java.util -import java.util.concurrent.* - -import org.apache.skywalking.apm.agent.core.context.{ ContextManager, ContextSnapshot } -import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance -import org.bitlap.skywalking.apm.plugin.common.* - -final class ThreadPoolExecutorWrapper(threadPoolExecutor: ThreadPoolExecutor) - extends ThreadPoolExecutor( - threadPoolExecutor.getCorePoolSize, - threadPoolExecutor.getMaximumPoolSize, - threadPoolExecutor.getKeepAliveTime(TimeUnit.MILLISECONDS), - TimeUnit.MILLISECONDS, - threadPoolExecutor.getQueue, - threadPoolExecutor.getThreadFactory, - threadPoolExecutor.getRejectedExecutionHandler - ) { - - override def execute(command: Runnable): Unit = - command match - case e: EnhancedInstance - if e.getSkyWalkingDynamicField.isInstanceOf[ContextSnapshot] || !ContextManager.isActive => - threadPoolExecutor.execute(command) - case _ => - threadPoolExecutor.execute( - new RunnableWrapper(command, ContextManager.capture(), threadPoolExecutor.getClass.getName, "execute") - ) -} diff --git a/shared/plugin-common/src/main/scala/org/bitlap/skywalking/apm/plugin/common/interceptor/CaptureContextInterceptor.scala b/shared/plugin-common/src/main/scala/org/bitlap/skywalking/apm/plugin/common/interceptor/CaptureContextInterceptor.scala index 31bbedc..fad5017 100644 --- a/shared/plugin-common/src/main/scala/org/bitlap/skywalking/apm/plugin/common/interceptor/CaptureContextInterceptor.scala +++ b/shared/plugin-common/src/main/scala/org/bitlap/skywalking/apm/plugin/common/interceptor/CaptureContextInterceptor.scala @@ -1,14 +1,11 @@ package org.bitlap.skywalking.apm.plugin.common.interceptor import java.lang.reflect.Method -import java.util.concurrent.Callable -import java.util.concurrent.RunnableFuture +import java.util.concurrent.{ Callable, RunnableFuture } import org.apache.skywalking.apm.agent.core.context.* import org.apache.skywalking.apm.agent.core.logging.api.LogManager import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.* -import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor -import org.apache.skywalking.apm.network.trace.component.ComponentsDefine import org.bitlap.skywalking.apm.plugin.common.* final class CaptureContextOnScheduleInterceptor extends CaptureContextInterceptor @@ -36,8 +33,9 @@ open class CaptureContextInterceptor extends InstanceMethodsAroundInterceptor: val argument = allArguments(0) // Avoid duplicate enhancement, such as the case where it has already been enhanced by RunnableWrapper or CallableWrapper with toolkit. argument match - case instance: EnhancedInstance if instance.getSkyWalkingDynamicField.isInstanceOf[ContextSnapshot] => - return + case instance: EnhancedInstance => + val ctx = instance.getSkyWalkingDynamicField + if ctx != null && ctx.isInstanceOf[ContextSnapshot] then return case _ => val wrappedObject = wrap(argument, objInst.getClass.getName, method.getName) if wrappedObject != null then allArguments.update(0, wrappedObject) diff --git a/version.sbt b/version.sbt index 8c7e5e0..ec41bc8 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -ThisBuild / version := "0.3.0-SNAPSHOT" +ThisBuild / version := "0.2.0-beta2"