Skip to content

Commit

Permalink
Wait for task completion future in cursor (facebookincubator#9225)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebookincubator#9225

Wait for the taskCompletionFuture in MultiTaskCursor's moveNext() method, currently we just fetch it.

(This was my bad, I thought it waited like waitForTaskDriversToFinish, but it just returns the future as the name suggests)

Reviewed By: xiaoxmeng

Differential Revision: D55261345

fbshipit-source-id: 540781ddec6608f1717991cb29f44c538f160439
  • Loading branch information
Kevin Wilfong authored and facebook-github-bot committed Mar 23, 2024
1 parent 458339f commit 3d30bf5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion velox/exec/tests/utils/Cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ class MultiThreadedTaskCursor : public TaskCursorBase {
if (task_->error()) {
// Wait for the task to finish (there's' a small period of time between
// when the error is set on the Task and terminate is called).
task_->taskCompletionFuture(1'000'000);
task_->taskCompletionFuture(1'000'000).wait();

// Wait for all task drivers to finish to avoid destroying the executor_
// before task_ finished using it and causing a crash.
Expand Down

0 comments on commit 3d30bf5

Please sign in to comment.