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

Inhibit direct conversion from future<future<T>> --> future<void> #2673

Merged
merged 1 commit into from Jun 6, 2017

Conversation

hkaiser
Copy link
Member

@hkaiser hkaiser commented Jun 1, 2017

@hkaiser
Copy link
Member Author

hkaiser commented Jun 1, 2017

@dmarce1 Please check this out and let us know if this fixes the issue you're seeing.

});

hpx::future<void> fut2 = std::move(fut);
fut2.get();
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we test here that the inner async has been executed after fut2.get() succeeded?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a test making sure that things don't compile. No testing of flags would make a difference.

Copy link
Member

Choose a reason for hiding this comment

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

ahh, missed that this is just a compile only test ... giving essentially the same test below, is a separate, compile only test really necessary? The test will fail if it does not compile.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not the same test. The compile-fail test makes sure the conversion future<future<T>> -> future<void> does not compile (T != void), while the other test makes sure the conversion future<future<void>> -> future<void> is doing what it is supposed to do, namely unwrapping the nested future.

hpx::future<void> fut2 = std::move(fut);
fut2.get();

HPX_TEST(t.elapsed() > 1.0);
Copy link
Member

Choose a reason for hiding this comment

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

Is checking the elapsed time the right thing to do or shouldn't we rather check if some flag or similar has been set?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, checking a flag can be done additionally. The time check is supposed to make sure that the collapsed future becomes ready only after the inner future.

Copy link
Member Author

Choose a reason for hiding this comment

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

@sithhell I now have added the additional check as you suggested.

@hkaiser
Copy link
Member Author

hkaiser commented Jun 5, 2017

@sithhell your comments have been addressed.

Copy link
Member

@dmarce1 dmarce1 left a comment

Choose a reason for hiding this comment

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

The bug I am seeing turns up with extreme irregularity. (I just ran for 2 days on 64 nodes without it appearing) I also have no way of knowing for sure (at this point) the problem addressed by this pull request is what is causing the bug. I was unable to reproduce the issue with a smaller test case. At this point I think we should merge and will recompile and rerun and wait and see.

@hkaiser
Copy link
Member Author

hkaiser commented Jun 6, 2017

@dmarce1 Thanks. We know for sure that this PR addresses a problem, it might not be the problem you were seeing. With this PR, did you see compilation errors with octotiger? Did you have to change anything?

@dmarce1
Copy link
Member

dmarce1 commented Jun 6, 2017

@hkaiser No compilation errors, didn't have to change anything. Everything appears to be working.

@hkaiser
Copy link
Member Author

hkaiser commented Jun 6, 2017

No compilation errors, didn't have to change anything. Everything appears to be working.

@dmarce1: ok, then you're most likely not affected by the problem this PR solves.

@hkaiser hkaiser merged commit 4efc50b into master Jun 6, 2017
@hkaiser hkaiser deleted the fixing_2667 branch June 6, 2017 17:16
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.

Ambiguity of nested hpx::future<void>'s.
3 participants