From 495873669b96c3d823640bd95a9363a0e8d7ddaf Mon Sep 17 00:00:00 2001 From: Sergei Malafeev Date: Wed, 24 Jul 2019 14:37:41 +0800 Subject: [PATCH 1/2] sync with master Signed-off-by: Sergei Malafeev --- .../contrib/specialagent/thread/ThreadAgentIntercept.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rules/specialagent-thread/src/main/java/io/opentracing/contrib/specialagent/thread/ThreadAgentIntercept.java b/rules/specialagent-thread/src/main/java/io/opentracing/contrib/specialagent/thread/ThreadAgentIntercept.java index e162b2734..6a99af0ab 100644 --- a/rules/specialagent-thread/src/main/java/io/opentracing/contrib/specialagent/thread/ThreadAgentIntercept.java +++ b/rules/specialagent-thread/src/main/java/io/opentracing/contrib/specialagent/thread/ThreadAgentIntercept.java @@ -29,6 +29,7 @@ public class ThreadAgentIntercept { private static final ThreadLocal scopeHandler = new ThreadLocal<>(); static { + System.out.println("Current class loader: " + ThreadAgentIntercept.class.getClassLoader()); try { if (ThreadAgentIntercept.class.getClassLoader() != null) cache = (Map)BootProxyClassLoader.INSTANCE.loadClass(ThreadAgentIntercept.class.getName()).getField("cache").get(null); @@ -46,11 +47,13 @@ public static void start(final Object thiz) { if (span != null) cache.put(thread.getId(), span); + System.out.println("start(" + thiz + " " + thread.getId() + "): " + span + " " + System.identityHashCode(cache) + " " + ThreadAgentRule.class.getClassLoader()); } public static void runEnter(final Object thiz) { final Thread thread = (Thread)thiz; final Span span = cache.get(thread.getId()); + System.out.println("enter(" + thiz + " " + thread.getId() + "): " + span + " " + System.identityHashCode(cache) + " " + ThreadAgentRule.class.getClassLoader()); if (span != null) { final Scope scope = GlobalTracer.get().activateSpan(span); scopeHandler.set(scope); @@ -60,6 +63,7 @@ public static void runEnter(final Object thiz) { public static void runExit(final Object thiz) { final Thread thread = (Thread)thiz; final Span span = cache.remove(thread.getId()); + System.out.println("exit(" + thiz + " " + thread.getId() + "): " + span + " " + System.identityHashCode(cache) + " " + ThreadAgentRule.class.getClassLoader()); final Scope scope = scopeHandler.get(); if (scope != null) scope.close(); From 4e6310e64ddbc7ab20f63cd0c5dedcbfdc82951c Mon Sep 17 00:00:00 2001 From: Sergei Malafeev Date: Wed, 24 Jul 2019 15:27:02 +0800 Subject: [PATCH 2/2] upgrade opentracing-grpc to 0.1.2 Signed-off-by: Sergei Malafeev --- rules/specialagent-grpc/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/specialagent-grpc/pom.xml b/rules/specialagent-grpc/pom.xml index d82bd57ca..710f8e8eb 100644 --- a/rules/specialagent-grpc/pom.xml +++ b/rules/specialagent-grpc/pom.xml @@ -87,7 +87,7 @@ io.opentracing.contrib opentracing-grpc - 0.1.1 + 0.1.2 io.grpc