Skip to content
Open
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
6 changes: 2 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageVersion Include="ImpromptuInterface" Version="7.0.1" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
<PackageVersion Include="Microsoft.ApplicationInsights" Version="2.23.0" />
<PackageVersion Include="Microsoft.AspNet.WebApi.OwinSelfHost" Version="5.3.0" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.8" />
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.Data.Services.Client" Version="5.8.5" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
Expand All @@ -31,9 +31,7 @@
<PackageVersion Include="OpenTelemetry.Api" Version="1.15.3" />
<PackageVersion Include="System.Collections.Immutable" Version="1.2.0" />
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="6.0.1" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="System.Reactive.Compatibility" Version="4.4.1" />
<PackageVersion Include="System.Reactive.Core" Version="4.4.1" />
<PackageVersion Include="System.Linq.AsyncEnumerable" Version="10.0.8" />
</ItemGroup>

<!-- Product dependencies with net48 only-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<PackageReference Include="Azure.Storage.Blobs" />
<PackageReference Include="Azure.Storage.Queues" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" />
<PackageReference Include="System.Linq.Async" />
<PackageReference Include="System.Linq.AsyncEnumerable" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ async Task<IEnumerable<MessageData>> DedupeExecutionStartedMessagesAsync(
// "Remote" -> the instance ID info comes from the Instances table that we're querying
IAsyncEnumerable<InstanceStatus> instances = this.trackingStore.FetchInstanceStatusAsync(instanceIds, cancellationToken);
IDictionary<string, InstanceStatus> remoteOrchestrationsById =
await instances.ToDictionaryAsync(o => o.State.OrchestrationInstance.InstanceId, cancellationToken);
await instances.ToDictionaryAsync(o => o.State.OrchestrationInstance.InstanceId, cancellationToken: cancellationToken);

foreach (MessageData message in executionStartedMessages)
{
Expand Down
33 changes: 29 additions & 4 deletions src/DurableTask.Core/CorrelationTraceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace DurableTask.Core
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.ExceptionServices;
using System.Threading.Tasks;
using DurableTask.Core.Settings;

Expand Down Expand Up @@ -46,13 +47,13 @@ public static void SetUp(
Action<Exception> trackExceptionAction)
{
listenerSubscription = DiagnosticListener.AllListeners.Subscribe(
delegate (DiagnosticListener listener)
new ActionObserver<DiagnosticListener>(listener =>
{
if (listener.Name == DiagnosticSourceName)
{
applicationInsightsSubscription?.Dispose();

applicationInsightsSubscription = listener.Subscribe((KeyValuePair<string, object> evt) =>
applicationInsightsSubscription = listener.Subscribe(new ActionObserver<KeyValuePair<string, object>>(evt =>
{
if (evt.Key == RequestTrackEvent)
{
Expand All @@ -72,9 +73,9 @@ public static void SetUp(
var e = (Exception)evt.Value;
trackExceptionAction(e);
}
});
}));
}
});
}));
}

/// <summary>
Expand Down Expand Up @@ -144,5 +145,29 @@ static void Execute(Action action)
action();
}
}

sealed class ActionObserver<T> : IObserver<T>
{
readonly Action<T> onNext;

public ActionObserver(Action<T> onNext)
{
this.onNext = onNext ?? throw new ArgumentNullException(nameof(onNext));
}

public void OnCompleted()
{
}

public void OnError(Exception error)
{
ExceptionDispatchInfo.Capture(error).Throw();
}
Comment on lines +162 to +165

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


public void OnNext(T value)
{
this.onNext(value);
}
}
}
}
2 changes: 0 additions & 2 deletions src/DurableTask.Core/DurableTask.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" />
<PackageReference Include="System.Reactive.Core" />
<PackageReference Include="System.Reactive.Compatibility" />
<PackageReference Include="Castle.Core" />
</ItemGroup>

Expand Down
Loading