lidavidm commented on a change in pull request #11207:
URL: https://github.com/apache/arrow/pull/11207#discussion_r714322177
##########
File path: cpp/src/arrow/util/async_generator.h
##########
@@ -221,6 +221,9 @@ class MappingGenerator {
bool should_trigger;
{
auto guard = state->mutex.Lock();
+ // A MappedCallback may have purged or be purging the queue;
+ // we shouldn't do anything here.
+ if (state->finished) return;
Review comment:
That test case uses an overload of MakeMappedGenerator which doesn't
exist in the fork (it takes a bool as the third argument) - what was the
purpose there?
##########
File path: cpp/src/arrow/util/async_generator.h
##########
@@ -1001,32 +1004,45 @@ class MergedGenerator {
};
struct InnerCallback {
Review comment:
Yup, that's it. And in particular the degenerate case here is that the
synchronously-run callback from the mapped generator's futures would pull from
the mapped generator, creating a loop implemented as (non-tail) recursion.
--
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]