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

[Bug] Failing to build completion does not use task token when creating failure #349

Closed
cretz opened this issue Sep 16, 2024 · 1 comment · Fixed by #353
Closed

[Bug] Failing to build completion does not use task token when creating failure #349

cretz opened this issue Sep 16, 2024 · 1 comment · Fixed by #353
Labels
bug Something isn't working

Comments

@cretz
Copy link
Member

cretz commented Sep 16, 2024

Describe the bug

In

catch (Exception e)
{
completion = new()
{
Result = new()
{
Failed = new()
{
Failure_ = new() { Message = $"Failed building completion: {e}" },
},
},
};
}
we have an extra catch if something happened that even the other catches couldn't catch (such as a failure while processing a failure), but we are not logging nor are we setting the task token. Make sure we do both and add test coverage to try and reach this code (i.e. try to fail while processing a failure).

@cretz cretz added the bug Something isn't working label Sep 16, 2024
@cretz
Copy link
Member Author

cretz commented Sep 23, 2024

This seems to occur on context cancel failing. To replicate the swallowing of this, try to do something like ActivityExecutionContext.Current.CancellationToken.Register(() => throw new InvalidOperationException("intentional failure")). The fix of course is to log the exception here and make sure the task token is set on this.

cretz added a commit to cretz/temporal-sdk-dotnet that referenced this issue Oct 8, 2024
@cretz cretz closed this as completed in #353 Oct 8, 2024
@cretz cretz closed this as completed in fb3c991 Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant