westonpace commented on pull request #12609:
URL: https://github.com/apache/arrow/pull/12609#issuecomment-1068842569


   > And maybe instead of putting Span on Future, it should be attached to the 
callback itself.
   
   This could work as well.  So every time we add a callback we (while adding 
the callback) grab the active span.  We then wrap the callback function like...
   
   ```
   auto activeSpan = GetCurrentSpan();
   auto wrapped = [activeSpan, callback] {
     SetCurrentSpan(activeSpan);
     callback();
   };
   ```
   
   (although you'd have to do an actual struct wrapper because `callback` 
should be move-only and we don't have move lambda captures yet)
   
   I think that's basically the same thing as what I was suggesting on the 
thread pool but it would only affect futures.  Given most of our thread tasks 
are futures I think this would probably be acceptable but I think I'd still 
lean towards implementing this in the executor if I were going to tackle it 
myself.


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