You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/08/11 21:54:17 UTC
[GitHub] [arrow] lidavidm commented on a change in pull request #10919: ARROW-13605: [C++] Capture node with shared_ptr to avoid TSan warning
lidavidm commented on a change in pull request #10919:
URL: https://github.com/apache/arrow/pull/10919#discussion_r687221713
##########
File path: cpp/src/arrow/compute/exec/aggregate_node.cc
##########
@@ -451,7 +452,8 @@ struct GroupByNode : ExecNode {
// bail if StopProducing was called
if (finished_.is_finished()) break;
- RETURN_NOT_OK(executor->Spawn([this, i] { OutputNthBatch(i); }));
+ auto self = checked_pointer_cast<GroupByNode>(shared_from_this());
+ RETURN_NOT_OK(executor->Spawn([self, i] { self->OutputNthBatch(i); }));
Review comment:
It works locally, even better! This should be better because it'll also preserve the validity of pointers in outputs_.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org