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

Fix Durable Functions preventing orchestrators from completing #2491

Merged
merged 3 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Fixes

- Fixes baggage propagation when an exception is thrown from middleware ([#2487](https://github.com/getsentry/sentry-dotnet/pull/2487))
- Fix Durable Functions preventing orchestrators from completing ([#2491](https://github.com/getsentry/sentry-dotnet/pull/2491))

### Dependencies

Expand Down
5 changes: 5 additions & 0 deletions src/Sentry.AzureFunctions.Worker/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[*.cs]

# Reason: Azure Functions worker doesn't set SynchronizationContext but Durable Functions does and required affinity.
# (https://github.com/Azure/azure-functions-dotnet-worker/issues/1520)
dotnet_diagnostic.CA2007.severity = none
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public SentryFunctionsWorkerMiddleware(IHub hub)

public async Task Invoke(FunctionContext context, FunctionExecutionDelegate next)
{
var transactionName = await GetHttpTransactionNameAsync(context).ConfigureAwait(false) ?? context.FunctionDefinition.Name;
var transactionName = await GetHttpTransactionNameAsync(context) ?? context.FunctionDefinition.Name;
var transaction = _hub.StartTransaction(transactionName, "function");
Exception? unhandledException = null;

Expand All @@ -35,7 +35,7 @@ public async Task Invoke(FunctionContext context, FunctionExecutionDelegate next

context.CancellationToken.ThrowIfCancellationRequested();

await next(context).ConfigureAwait(false);
await next(context);
}
catch (Exception exception)
{
Expand Down Expand Up @@ -76,7 +76,7 @@ public async Task Invoke(FunctionContext context, FunctionExecutionDelegate next
private static async Task<string?> GetHttpTransactionNameAsync(FunctionContext context)
{
// Get the HTTP request data
var requestData = await context.GetHttpRequestDataAsync().ConfigureAwait(false);
var requestData = await context.GetHttpRequestDataAsync();
if (requestData is null)
{
// not an HTTP trigger
Expand Down