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

Properly dispatch exceptions thrown from hpx_main to be rethrown from hpx::init/hpx::stop #4487

Merged
merged 5 commits into from
Apr 8, 2020

Conversation

hkaiser
Copy link
Member

@hkaiser hkaiser commented Apr 1, 2020

No description provided.

msimberg
msimberg previously approved these changes Apr 1, 2020
Copy link
Contributor

@msimberg msimberg left a comment

Choose a reason for hiding this comment

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

Very nice, thanks!

@msimberg
Copy link
Contributor

msimberg commented Apr 2, 2020

Hmm, this is throwing more/in a different place than some of our tests expect. We do have some tests that catch an exception thrown in hpx_main (error_callback is the simplest). What sort of exceptions were not propagated up through init/main?

@msimberg
Copy link
Contributor

msimberg commented Apr 2, 2020

report_error is mean to store exceptions thrown, which the runtime then rethrows after everything has been shut down. Could it be that report_error is not getting called, or encounters an error itself (did the application hang?)?

@hkaiser
Copy link
Member Author

hkaiser commented Apr 2, 2020

Hmm, this is throwing more/in a different place than some of our tests expect. We do have some tests that catch an exception thrown in hpx_main (error_callback is the simplest). What sort of exceptions were not propagated up through init/main?

I'll investigate.

- flyby: make existing test cover the new functionality
- flyby: adding asserts to shared_priority_queue_scheduler to avoid using -1 as array indices
@msimberg
Copy link
Contributor

msimberg commented Apr 6, 2020

@hkaiser I've attempted to clean up the thread number handling. local_num is allowed to be -1, for example when creating a thread from a non-worker thread (like spawning hpx_main/run_helper as was the case here). @biddisco could you have a look to see if the changes to the shared_priority_queue_scheduler make sense?

@hkaiser
Copy link
Member Author

hkaiser commented Apr 6, 2020

@hkaiser I've attempted to clean up the thread number handling. local_num is allowed to be -1, for example when creating a thread from a non-worker thread (like spawning hpx_main/run_helper as was the case here).

Thanks @msimberg. I did suspect that much, but was not sure what the correct handling in the scheduler should be. Let's see how the tests fare.

@msimberg msimberg merged commit 969833a into master Apr 8, 2020
@msimberg msimberg deleted the fixing_hpx_main_exceptions branch April 8, 2020 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants