Commits

Weston Pace authored 681ede6fcb8
ARROW-15604: [C++][CI] Sporadic ThreadSanitizer failure with OpenTracing The particular cause of the failure was: ``` void InputReceived(ExecNode* input, ExecBatch batch) override { EVENT(span_, "InputReceived", {{"batch.length", batch.length}}); util::tracing::Span span; START_SPAN_WITH_PARENT(span, span_, "InputReceived", {{"node.label", label()}, {"batch.length", batch.length}}); DCHECK_EQ(input, inputs_[0]); bool did_push = producer_.Push(std::move(batch)); if (!did_push) return; // producer_ was Closed already if (input_counter_.Increment()) { // This will mark the exec plan finished Finish(); // At this point the main thread is generally free to exit but span hasn't been destructed yet } } ``` It could be fixed with scoping: ``` void InputReceived(ExecNode* input, ExecBatch batch) override { EVENT(span_, "InputReceived", {{"batch.length", batch.length}}); { util::tracing::Span span; START_SPAN_WITH_PARENT(span, span_, "InputReceived", {{"node.label", label()}, {"batch.length", batch.length}}); DCHECK_EQ(input, inputs_[0]); bool did_push = producer_.Push(std::move(batch)); if (!did_push) return; // producer_ was Closed already } if (input_counter_.Increment()) { // This will mark the exec plan finished Finish(); } } ``` However, I suspect this would quickly get tedious. Instead it seems we can control the lifetime of the OT runtime storage and bind it to our worker threads. In the future we may want to consider doing similar tricks to keep alive the memory pool, global thread pools, etc. Closes #12408 from westonpace/bugfix/ARROW-15604--sporadic-test-failure-with-ot Authored-by: Weston Pace <weston.pace@gmail.com> Signed-off-by: Weston Pace <weston.pace@gmail.com>