lidavidm edited a comment on pull request #9656: URL: https://github.com/apache/arrow/pull/9656#issuecomment-813657680
I think what's happening is that the rest of the program completes quickly enough that we're running global destructors before/while the worker thread is running the Future's destructor (by means of running the callback's destructor). Hence, when the Buffer's destructor runs (by way of Future's destructor), the global memory pool it references has already been destructed. Manually shutting down the thread pool in main() seems to resolve it, as you would expect. But that's not a real solution. We could move all definitions of globals (or at least, memory and thread pools) into the same translation unit. That would shuffle around a lot of code and lead to a mess. Or perhaps we could construct the memory pool with a static shared_ptr with a custom deleter that shuts down the global thread pools. Either way, what we're facing is an issue with the order of global destructors… -- 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. For queries about this service, please contact Infrastructure at: [email protected]
