yanglimingcn commented on issue #2315:
URL: https://github.com/apache/brpc/issues/2315#issuecomment-1894806712

   @wwbmmm 这个问题我最近想出一个方案来解决,想和你讨论一下:
   
现在启动bthread如果加上BTHREAD_INHERIT_SPAN标志,bthread会继承span,为了修复这个问题,简单的方法是在创建bthread的时候,如果有BTHREAD_INHERIT_SPAN这个标志,就执行一次Span::CreateClientSpan,创建一个client
 span,让这个client span成为m->local_storage.rpcz_parent_span。
   这样做的
   优势在于,创建span仍然是能够完全规避了线程竞争,所以对性能应该很友好。
   缺点在于,会增加一些span的数量。
   
实现难度很低,但是也会有个问题,就是需要在bthread层面调用Span::CreateClientSpan,但是Span::CreateClientSpan是在brpc这个层面上,代码调用关系可能有些不合理。


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to