yanghao605 commented on code in PR #4057:
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/4057#discussion_r1405796295


##########
handlers/handler-tracing-zipkin/src/main/java/org/apache/servicecomb/tracing/zipkin/ZipkinConsumerDelegate.java:
##########
@@ -50,7 +50,7 @@ class ZipkinConsumerDelegate implements ZipkinTracingDelegate 
{
   }
 
   @Override
-  public Span createSpan(Invocation invocation) {
+  public synchronized Span createSpan(Invocation invocation) {
     return handler.handleSend(requestWrapper.invocation(invocation));
   }

Review Comment:
   Based on my understanding of the brave's source code, I think only this part 
can set context to invocation.
   
![image](https://github.com/apache/servicecomb-java-chassis/assets/73453250/e3af5482-a68e-4826-8680-673d2430b235)
   When the handler. handleSend() method is called, it will insert the context 
related to trace into the invocation.
   
![image](https://github.com/apache/servicecomb-java-chassis/assets/73453250/1f586525-1813-442f-a3ae-3c1d396c1614)
   
![image](https://github.com/apache/servicecomb-java-chassis/assets/73453250/204b068c-a9a8-4e61-8f33-0533b6aa7fae)
   
   And after I added synchronized and tested again, there was no further loss 
of context
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to