-
Notifications
You must be signed in to change notification settings - Fork 51
Fix TemporalWorker::ExecuteAsync(Func<Task>) swallowing exceptions #600
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
Conversation
|
Austin Deal seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just one minor pedantic suggestion to simplify the test.
And don't forget to sign the CLA (link is above here in PR)
| public Task ExecuteAsync( | ||
| Func<Task> untilComplete, CancellationToken stoppingToken = default) => | ||
| ExecuteInternalAsync( | ||
| () => untilComplete().ContinueWith( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, it is confusing that .NET doesn't really have a "map-on-success" combinator and that continue-with inadvertently swallows failures here. Thanks for the fix!
I see one other place we'll need to fix this type of thinking (Temporalio.Workflows.Semaphore for a failure in a wait condition), but we can handle that in a separate issue, no worries.
cretz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One change needed, to use the existing shared environment instead of making a new one for just this test
What was changed
TemporalWorker::ExecuteAsync(Func<Task>)swallowing exceptionsWhy?
The non-generic
ExecuteAsync(Func<Task>)overload was usingContinueWithwithTaskContinuationOptions.OnlyOnRanToCompletion. When the caller's task threw an exception, this option prevented the continuation from running, causing the continuation task to be canceled rather than faulted. This resulted inTaskCanceledExceptionbeing thrown instead of the original exception (e.g.,WorkflowFailedException).Checklist
Closes [Bug] TemporalWorker::ExecuteAsync(Func<Task>) swallows exceptions, throws TaskCanceledException instead #599
How was this tested:
Added regression test
ExecuteAsync_PropagatesException.Any docs updates needed?
No.