File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
agent/src/main/java/com/microsoft/applicationinsights/agent/internal/model Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,11 @@ public Span startAndMarkAsyncTransactionComplete() {
5353 private Span start (boolean completeAsyncTransaction ) {
5454 ThreadContextThreadLocal .Holder threadContextHolder = Global .getThreadContextHolder ();
5555 ThreadContextPlus threadContext = threadContextHolder .get ();
56- if (threadContext != null ) {
56+ // TODO once local spans are supported, only return NOP if parent spans are the same
57+ // Checking if in same request is needed in case the existing thread context is from a prior request
58+ // (e.g. this can happen if the thread activity was captured via Thread constructor, but the thread was
59+ // really then used in a thread pool)
60+ if (threadContext != null && threadContext .getServletRequestInfo () == servletRequestInfo ) {
5761 if (completeAsyncTransaction ) {
5862 threadContext .setTransactionAsyncComplete ();
5963 }
You can’t perform that action at this time.
0 commit comments