Skip to content

Commit 7374901

Browse files
DanLi39mr3
authored andcommitted
fix: threadlocal context transmit exclude callDepth
1 parent 41e91b4 commit 7374901

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/ctx/ArexThreadLocal.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.arex.agent.bootstrap.ctx;
22

3+
import io.arex.agent.bootstrap.internal.CallDepth;
34
import java.util.HashMap;
45
import java.util.Iterator;
56
import java.util.Map;
@@ -137,7 +138,11 @@ private static void restoreValues(HashMap<ArexThreadLocal<Object>, Object> backu
137138
public static void setTtlTo(HashMap<ArexThreadLocal<Object>, Object> ttlValues) {
138139
for (Map.Entry<ArexThreadLocal<Object>, Object> entry : ttlValues.entrySet()) {
139140
ArexThreadLocal<Object> threadLocal = entry.getKey();
140-
threadLocal.set(entry.getValue());
141+
Object value = entry.getValue();
142+
if (value instanceof CallDepth) {
143+
continue;
144+
}
145+
threadLocal.set(value);
141146
}
142147
}
143148

0 commit comments

Comments
 (0)