From f85dab000f055265af6317942d2a29dd4db68fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=9F=E6=B5=B7?= Date: Mon, 27 May 2024 10:26:58 +0800 Subject: [PATCH] Fixed span clone concurrency issues --- pom.xml | 2 +- sofa-tracer-plugins/sofa-tracer-datasource-plugin/pom.xml | 2 +- .../sofa-tracer-dubbo-2.6.x-plugin/pom.xml | 2 +- .../sofa-tracer-dubbo-common-plugin/pom.xml | 2 +- sofa-tracer-plugins/sofa-tracer-dubbo-plugin/pom.xml | 2 +- sofa-tracer-plugins/sofa-tracer-flexible-plugin/pom.xml | 2 +- sofa-tracer-plugins/sofa-tracer-httpclient-plugin/pom.xml | 2 +- sofa-tracer-plugins/sofa-tracer-kafkamq-plugin/pom.xml | 2 +- sofa-tracer-plugins/sofa-tracer-mongodb-plugin/pom.xml | 2 +- sofa-tracer-plugins/sofa-tracer-okhttp-plugin/pom.xml | 2 +- sofa-tracer-plugins/sofa-tracer-rabbitmq-plugin/pom.xml | 2 +- sofa-tracer-plugins/sofa-tracer-redis-plugin/pom.xml | 2 +- .../sofa-tracer-resttmplate-plugin/pom.xml | 2 +- sofa-tracer-plugins/sofa-tracer-rocketmq-plugin/pom.xml | 2 +- .../sofa-tracer-spring-cloud-plugin/pom.xml | 2 +- .../sofa-tracer-springmessage-plugin/pom.xml | 2 +- sofa-tracer-plugins/sofa-tracer-springmvc-plugin/pom.xml | 2 +- sofa-tracer-plugins/sofa-tracer-zipkin-plugin/pom.xml | 2 +- tracer-all/pom.xml | 4 ++-- tracer-core/pom.xml | 2 +- .../alipay/common/tracer/core/span/SofaTracerSpan.java | 8 ++++---- tracer-extensions/pom.xml | 2 +- tracer-sofa-boot-starter/pom.xml | 2 +- tracer-test/core-test/pom.xml | 2 +- tracer-test/log4j-test/pom.xml | 2 +- tracer-test/log4j2-test/pom.xml | 2 +- tracer-test/logback-test/pom.xml | 2 +- 27 files changed, 31 insertions(+), 31 deletions(-) diff --git a/pom.xml b/pom.xml index 8773db634..4e7ed8b0d 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ tracer-all-parent - 3.1.3 + 3.1.4-SNAPSHOT pom tracer-all-parent Alipay SOFATracer Log Implemented by OpenTracing diff --git a/sofa-tracer-plugins/sofa-tracer-datasource-plugin/pom.xml b/sofa-tracer-plugins/sofa-tracer-datasource-plugin/pom.xml index f7572baa2..98657728d 100644 --- a/sofa-tracer-plugins/sofa-tracer-datasource-plugin/pom.xml +++ b/sofa-tracer-plugins/sofa-tracer-datasource-plugin/pom.xml @@ -5,7 +5,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/sofa-tracer-plugins/sofa-tracer-dubbo-2.6.x-plugin/pom.xml b/sofa-tracer-plugins/sofa-tracer-dubbo-2.6.x-plugin/pom.xml index bbf7134f8..c3ad6d9c7 100644 --- a/sofa-tracer-plugins/sofa-tracer-dubbo-2.6.x-plugin/pom.xml +++ b/sofa-tracer-plugins/sofa-tracer-dubbo-2.6.x-plugin/pom.xml @@ -5,7 +5,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/sofa-tracer-plugins/sofa-tracer-dubbo-common-plugin/pom.xml b/sofa-tracer-plugins/sofa-tracer-dubbo-common-plugin/pom.xml index 8081f4f60..d467e7d75 100644 --- a/sofa-tracer-plugins/sofa-tracer-dubbo-common-plugin/pom.xml +++ b/sofa-tracer-plugins/sofa-tracer-dubbo-common-plugin/pom.xml @@ -5,7 +5,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/sofa-tracer-plugins/sofa-tracer-dubbo-plugin/pom.xml b/sofa-tracer-plugins/sofa-tracer-dubbo-plugin/pom.xml index 4f42c058f..7807636cc 100644 --- a/sofa-tracer-plugins/sofa-tracer-dubbo-plugin/pom.xml +++ b/sofa-tracer-plugins/sofa-tracer-dubbo-plugin/pom.xml @@ -5,7 +5,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/sofa-tracer-plugins/sofa-tracer-flexible-plugin/pom.xml b/sofa-tracer-plugins/sofa-tracer-flexible-plugin/pom.xml index 71e071765..efbcac4d9 100644 --- a/sofa-tracer-plugins/sofa-tracer-flexible-plugin/pom.xml +++ b/sofa-tracer-plugins/sofa-tracer-flexible-plugin/pom.xml @@ -5,7 +5,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/sofa-tracer-plugins/sofa-tracer-httpclient-plugin/pom.xml b/sofa-tracer-plugins/sofa-tracer-httpclient-plugin/pom.xml index 321c4aa1b..fa0bc4f14 100644 --- a/sofa-tracer-plugins/sofa-tracer-httpclient-plugin/pom.xml +++ b/sofa-tracer-plugins/sofa-tracer-httpclient-plugin/pom.xml @@ -5,7 +5,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/sofa-tracer-plugins/sofa-tracer-kafkamq-plugin/pom.xml b/sofa-tracer-plugins/sofa-tracer-kafkamq-plugin/pom.xml index e0cd8dfac..20678e0bf 100644 --- a/sofa-tracer-plugins/sofa-tracer-kafkamq-plugin/pom.xml +++ b/sofa-tracer-plugins/sofa-tracer-kafkamq-plugin/pom.xml @@ -5,7 +5,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/sofa-tracer-plugins/sofa-tracer-mongodb-plugin/pom.xml b/sofa-tracer-plugins/sofa-tracer-mongodb-plugin/pom.xml index 33c14d7ce..e0b93b727 100644 --- a/sofa-tracer-plugins/sofa-tracer-mongodb-plugin/pom.xml +++ b/sofa-tracer-plugins/sofa-tracer-mongodb-plugin/pom.xml @@ -5,7 +5,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/sofa-tracer-plugins/sofa-tracer-okhttp-plugin/pom.xml b/sofa-tracer-plugins/sofa-tracer-okhttp-plugin/pom.xml index 74b12ae76..9f03bf6fa 100644 --- a/sofa-tracer-plugins/sofa-tracer-okhttp-plugin/pom.xml +++ b/sofa-tracer-plugins/sofa-tracer-okhttp-plugin/pom.xml @@ -5,7 +5,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/sofa-tracer-plugins/sofa-tracer-rabbitmq-plugin/pom.xml b/sofa-tracer-plugins/sofa-tracer-rabbitmq-plugin/pom.xml index 070bf11fa..dfd8efef3 100644 --- a/sofa-tracer-plugins/sofa-tracer-rabbitmq-plugin/pom.xml +++ b/sofa-tracer-plugins/sofa-tracer-rabbitmq-plugin/pom.xml @@ -5,7 +5,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/sofa-tracer-plugins/sofa-tracer-redis-plugin/pom.xml b/sofa-tracer-plugins/sofa-tracer-redis-plugin/pom.xml index a4a4b2e87..a9ca12eaa 100644 --- a/sofa-tracer-plugins/sofa-tracer-redis-plugin/pom.xml +++ b/sofa-tracer-plugins/sofa-tracer-redis-plugin/pom.xml @@ -5,7 +5,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/sofa-tracer-plugins/sofa-tracer-resttmplate-plugin/pom.xml b/sofa-tracer-plugins/sofa-tracer-resttmplate-plugin/pom.xml index f48538e06..17c6d2661 100644 --- a/sofa-tracer-plugins/sofa-tracer-resttmplate-plugin/pom.xml +++ b/sofa-tracer-plugins/sofa-tracer-resttmplate-plugin/pom.xml @@ -5,7 +5,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/sofa-tracer-plugins/sofa-tracer-rocketmq-plugin/pom.xml b/sofa-tracer-plugins/sofa-tracer-rocketmq-plugin/pom.xml index 035f972ad..7b4d83759 100644 --- a/sofa-tracer-plugins/sofa-tracer-rocketmq-plugin/pom.xml +++ b/sofa-tracer-plugins/sofa-tracer-rocketmq-plugin/pom.xml @@ -5,7 +5,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/sofa-tracer-plugins/sofa-tracer-spring-cloud-plugin/pom.xml b/sofa-tracer-plugins/sofa-tracer-spring-cloud-plugin/pom.xml index 6a8ee7082..d331c774a 100644 --- a/sofa-tracer-plugins/sofa-tracer-spring-cloud-plugin/pom.xml +++ b/sofa-tracer-plugins/sofa-tracer-spring-cloud-plugin/pom.xml @@ -5,7 +5,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/sofa-tracer-plugins/sofa-tracer-springmessage-plugin/pom.xml b/sofa-tracer-plugins/sofa-tracer-springmessage-plugin/pom.xml index a4717adb7..78f8c42c3 100644 --- a/sofa-tracer-plugins/sofa-tracer-springmessage-plugin/pom.xml +++ b/sofa-tracer-plugins/sofa-tracer-springmessage-plugin/pom.xml @@ -5,7 +5,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/sofa-tracer-plugins/sofa-tracer-springmvc-plugin/pom.xml b/sofa-tracer-plugins/sofa-tracer-springmvc-plugin/pom.xml index 1d03303c1..236ac3004 100644 --- a/sofa-tracer-plugins/sofa-tracer-springmvc-plugin/pom.xml +++ b/sofa-tracer-plugins/sofa-tracer-springmvc-plugin/pom.xml @@ -4,7 +4,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml diff --git a/sofa-tracer-plugins/sofa-tracer-zipkin-plugin/pom.xml b/sofa-tracer-plugins/sofa-tracer-zipkin-plugin/pom.xml index 90d32a435..2d10bf4e9 100644 --- a/sofa-tracer-plugins/sofa-tracer-zipkin-plugin/pom.xml +++ b/sofa-tracer-plugins/sofa-tracer-zipkin-plugin/pom.xml @@ -5,7 +5,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/tracer-all/pom.xml b/tracer-all/pom.xml index 35117679b..a1dfc1f79 100644 --- a/tracer-all/pom.xml +++ b/tracer-all/pom.xml @@ -5,12 +5,12 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT 4.0.0 tracer-all - 3.1.3 + 3.1.4-SNAPSHOT jar SOFATracer in one without SOFABoot starter diff --git a/tracer-core/pom.xml b/tracer-core/pom.xml index f77d00638..6a6e4549c 100644 --- a/tracer-core/pom.xml +++ b/tracer-core/pom.xml @@ -4,7 +4,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../pom.xml diff --git a/tracer-core/src/main/java/com/alipay/common/tracer/core/span/SofaTracerSpan.java b/tracer-core/src/main/java/com/alipay/common/tracer/core/span/SofaTracerSpan.java index 91d21313d..e39a7fc08 100644 --- a/tracer-core/src/main/java/com/alipay/common/tracer/core/span/SofaTracerSpan.java +++ b/tracer-core/src/main/java/com/alipay/common/tracer/core/span/SofaTracerSpan.java @@ -36,10 +36,10 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; -import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; /** * SofaTracerSpan @@ -55,11 +55,11 @@ public class SofaTracerSpan implements Span { private final List spanReferences; /** tags for String */ - private final Map tagsWithStr = new LinkedHashMap<>(); + private final Map tagsWithStr = new ConcurrentHashMap<>(); /** tags for Boolean */ - private final Map tagsWithBool = new LinkedHashMap<>(); + private final Map tagsWithBool = new ConcurrentHashMap<>(); /** tags for Number */ - private final Map tagsWithNumber = new LinkedHashMap<>(); + private final Map tagsWithNumber = new ConcurrentHashMap<>(); private final List logs = new LinkedList<>(); diff --git a/tracer-extensions/pom.xml b/tracer-extensions/pom.xml index f18ac57fa..1e0a522f7 100644 --- a/tracer-extensions/pom.xml +++ b/tracer-extensions/pom.xml @@ -4,7 +4,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT tracer-extensions diff --git a/tracer-sofa-boot-starter/pom.xml b/tracer-sofa-boot-starter/pom.xml index d0ee6eb68..286b20483 100644 --- a/tracer-sofa-boot-starter/pom.xml +++ b/tracer-sofa-boot-starter/pom.xml @@ -5,7 +5,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../pom.xml diff --git a/tracer-test/core-test/pom.xml b/tracer-test/core-test/pom.xml index ae62bd314..6eee1a835 100644 --- a/tracer-test/core-test/pom.xml +++ b/tracer-test/core-test/pom.xml @@ -4,7 +4,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml diff --git a/tracer-test/log4j-test/pom.xml b/tracer-test/log4j-test/pom.xml index b5ee59052..cff74d776 100644 --- a/tracer-test/log4j-test/pom.xml +++ b/tracer-test/log4j-test/pom.xml @@ -4,7 +4,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml diff --git a/tracer-test/log4j2-test/pom.xml b/tracer-test/log4j2-test/pom.xml index d6fca9f99..d9c88d664 100644 --- a/tracer-test/log4j2-test/pom.xml +++ b/tracer-test/log4j2-test/pom.xml @@ -4,7 +4,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml diff --git a/tracer-test/logback-test/pom.xml b/tracer-test/logback-test/pom.xml index 364a211bf..ab3446698 100644 --- a/tracer-test/logback-test/pom.xml +++ b/tracer-test/logback-test/pom.xml @@ -4,7 +4,7 @@ tracer-all-parent com.alipay.sofa - 3.1.3 + 3.1.4-SNAPSHOT ../../pom.xml