westonpace opened a new pull request #12408:
URL: https://github.com/apache/arrow/pull/12408


   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();
         // At this point the main thread is generally free to exit but span 
hasn't been destructed yet
       }
     }
   ```
   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.


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