Open shengxiang205 opened 5 years ago
code in WebfluxSofaTracrFilter.java using code:
SofaTracerSpan springMvcSpan = springMvcTracer.serverReceive(spanContext);
to create first SofaTracerSpan,
but serverReceive
in AbstractTracer
using
SofaTraceContext sofaTraceContext = SofaTraceContextHolder.getSofaTraceContext();
SofaTracerSpan serverSpan = sofaTraceContext.pop();
to keep SofaTracerSpan in ThreadLocal
as we known, in concurrent mode, multi reactor stream may share same thread, it will lead to unknown bug with thread local variables
Describe the bug
when we using webflux with sofa tracer, we have controller code like this:
application.properties:
we visit http://localhost:8080/springwebflux in concurrent mode with env
-Dreactor.netty.ioWorkerCount=1
Expected behavior
logs/tracelog/spring-mvc-digest.log
should have output lines for every requestActual behavior
logs/tracelog/spring-mvc-digest.log
lost some logsSteps to reproduce
Minimal yet complete reproducer code (or GitHub URL to code)
Environment
java -version
):uname -a
):