Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a mistake about exception handling in asynchronous execution of scan_partitioner. #3040

Merged
merged 1 commit into from Dec 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 0 additions & 13 deletions hpx/parallel/util/scan_partitioner.hpp
Expand Up @@ -349,19 +349,6 @@ namespace hpx { namespace parallel { namespace util
f1, f2, f3, f4);
});

if (f.has_exception())
{
try {
std::rethrow_exception(f.get_exception_ptr());
}
catch (std::bad_alloc const& ba) {
throw ba;
}
catch (...) {
return hpx::make_exceptional_future<R>(std::current_exception());
}
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you elaborate on why this has to be removed please?

Copy link
Member Author

@taeguk taeguk Dec 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sithhell This is fundamentally wrong.
f.has_exception() always returns false when the task is running.
And, even if f.has_exception() can return true, this code is still wrong because occurred exception must be wrapped into the future.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the clarification. makes sense.

return f;
}
};
Expand Down