-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Process : Fix exception handling in
acquireCollaborativeResult()
When an exception was thrown from `ProcessType::run()`, we were catching it and rethrowing it from the code path that initiated the collaboration. But since we were rethrowing after the `run_and_wait()`, collaborating threads could leave their `wait()` before the exception was rethrown. In this case, they would throw their own vague exception about there being no result available, and this exception could be the first thrown, and therefore the first one to surface back to the caller. We now store the original exception in `TypedCollaboration::result` (now a variant) so that both the initiator and the collaborator throw the same exception. _Technically_ this is an ABI break, because it changes a member in TypedCollaboration. But for it to cause a problem, the following conditions would need to be met : - Someone would need to be using `acquireCollaborativeResult()` already. I'm not aware of anyone ever creating their own Process subclass, so the chances of someone doing that _and_ using a new feature that was only released yesterday are vanishingly small. - They would also need to compile some code with the old definition, and some with the new, which again is vanishingly unlikely, as Process subclasses are usually completely hidden. I think it's pretty clear that the lesser evil in this case is to fix the bug.
- Loading branch information
1 parent
f7a4f97
commit 6a02316
Showing
3 changed files
with
60 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters