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

for_each stuck after exception? #590

Closed
andrea-cassioli-maersk opened this issue May 16, 2024 · 2 comments
Closed

for_each stuck after exception? #590

andrea-cassioli-maersk opened this issue May 16, 2024 · 2 comments

Comments

@andrea-cassioli-maersk
Copy link

andrea-cassioli-maersk commented May 16, 2024

Hi,
I am using for_each to execute some tasks and I noticed that if an exception is thrown, the future waits forever. The code is like

tf::Taskflow tf;
  tf.for_each(indices.begin(), indices.end(), [&](const auto& index) {
  if(index == 0) throw std::runtime_error("FOO"); // I know 0 is in indices
}

auto f = tf::Executor().run(taskflow);
f.wait(); // never get out of here

I am working with version 3.7.0 and compiling on clang 17. I have been looking into

https://taskflow.github.io/taskflow/ExceptionHandling.html#CatchAnExceptionFromARunningTaskflow

and I can't see what is going on.

@tsung-wei-huang
Copy link
Member

@andrea-cassioli-maersk I will look into this.

@andrea-cassioli-maersk
Copy link
Author

@tsung-wei-huang apologies, I must have made a mistake installing 3.7! A new fresh installation, removing 3.6 first, have solved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants