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/12/15 13:15:11 UTC

[GitHub] [arrow] lidavidm commented on a change in pull request #11958: ARROW-15090: [C++] SerializedAsyncTaskGroup does not finish if an error arrives while there are still tasks to run

lidavidm commented on a change in pull request #11958:
URL: https://github.com/apache/arrow/pull/11958#discussion_r769611038



##########
File path: cpp/src/arrow/util/async_util_test.cc
##########
@@ -158,6 +158,22 @@ TYPED_TEST(TypedTestAsyncTaskGroup, Error) {
   ASSERT_FINISHES_AND_RAISES(Invalid, task_group.End());
 }
 
+TYPED_TEST(TypedTestAsyncTaskGroup, ErrorWhileNotEmpty) {
+  TypeParam task_group;
+  Future<> pending_task = Future<>::Make();
+  Future<> will_fail_task = Future<>::Make();
+  Future<> after_fail_task = Future<>::Make();
+  ASSERT_OK(task_group.AddTask([pending_task] { return pending_task; }));
+  ASSERT_OK(task_group.AddTask([will_fail_task] { return will_fail_task; }));
+  ASSERT_OK(task_group.AddTask([after_fail_task] { return after_fail_task; }));
+  Future<> end = task_group.End();
+  AssertNotFinished(end);
+  pending_task.MarkFinished();
+  will_fail_task.MarkFinished(Status::Invalid("XYZ"));
+  after_fail_task.MarkFinished();

Review comment:
       The group will complete even if the last task is not completed, right?




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