You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Todd Farmer (Jira)" <ji...@apache.org> on 2022/07/12 14:05:02 UTC

[jira] [Assigned] (ARROW-14376) [C++] Split PushGenerator producer into separately tracked entity

     [ https://issues.apache.org/jira/browse/ARROW-14376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todd Farmer reassigned ARROW-14376:
-----------------------------------

    Assignee:     (was: Weston Pace)

This issue was last updated over 90 days ago, which may be an indication it is no longer being actively worked. To better reflect the current state, the issue is being unassigned. Please feel free to re-take assignment of the issue if it is being actively worked, or if you plan to start that work soon.

> [C++] Split PushGenerator producer into separately tracked entity 
> ------------------------------------------------------------------
>
>                 Key: ARROW-14376
>                 URL: https://issues.apache.org/jira/browse/ARROW-14376
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Weston Pace
>            Priority: Major
>
> The PushGenerator keeps a strong reference to its producer, keeping it alive until the generator closes.  This means the producer will never auto-close if all references to it are lost.  This can lead to memory leaks like:
> {code:cpp}
> TEST(Weston, MemTest) {
>   PushGenerator<util::optional<int>> int_prod;
>   AsyncGenerator<util::optional<int>> int_gen = int_prod;
>   Future<> visit_fut = VisitAsyncGenerator(std::move(int_gen), [] (util::optional<int>) {
>     return Status::OK();
>   });
> }
> {code}
> If we split the push generator creation code so it creates both a producer and a generator as separate objects then the lifecycle for the producer can be tracked separately and, if all references are lost, it can abort the iteration.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)