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



##########
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've changed both of them into the same style as another task wrapper I 
saw a bit lower in `future.cc` (in `RunOrScheduleCallback`




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