joosthooz commented on a change in pull request #12609:
URL: https://github.com/apache/arrow/pull/12609#discussion_r838527580



##########
File path: cpp/src/arrow/util/thread_pool.cc
##########
@@ -58,6 +60,19 @@ SerialExecutor::~SerialExecutor() = default;
 
 Status SerialExecutor::SpawnReal(TaskHints hints, FnOnce<void()> task,
                                  StopToken stop_token, StopCallback&& 
stop_callback) {
+#ifdef ARROW_WITH_OPENTELEMETRY
+  // Wrap the task to propagate a parent tracing span to it
+  struct {
+    void operator()() {
+      auto scope = 
::arrow::internal::tracing::GetTracer()->WithActiveSpan(activeSpan);
+      std::move(func)();
+    }
+    FnOnce<void()> func;
+    opentelemetry::nostd::shared_ptr<opentelemetry::trace::Span> activeSpan;
+  } wrapper{std::forward<FnOnce<void()>>(task),

Review comment:
       I changed this, and the equivalent in `future.cc`, into `std::move` 
(which is also used in another task wrapper I saw in `future.cc`)




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