Skip to content

Fix fork_join exception fallback storage - #2170

Open
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix/fork-join-exception-fallback
Open

Fix fork_join exception fallback storage#2170
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix/fork-join-exception-fallback

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

This fixes the exception fallback in exec::fork_join.

When caching a potentially throwing completion argument, fork_join currently tries to emplace the exception result through _cache_._results_. The cache is already a __results_storage, so that member does not exist and the template branch fails to compile when instantiated.

The fix emplaces the set_error(std::exception_ptr) tuple directly into _cache_.

The regression test uses a value with a potentially throwing copy constructor, returns it by reference from just_from, and verifies that sync_wait rethrows the copy failure.

Tests:

  • cmake --build build --target test.exec -j 4
  • build/test/exec/test.exec '[adaptors][fork_join]'
  • build/test/exec/test.exec

@copy-pr-bot

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@fallintoplace