Skip to content

Commit 47651dc

Browse files
YunchuWangCopilot
andcommitted
Stop self-registering PayloadStore on the client; consume the shared store
Restore the original design: the client never registers a PayloadStore, it only consumes a shared/external one (via AddExternalizedPayloadStore or an in-process worker). Only the worker self-registers a fallback store. Remove the client Core's TryAddSingleton<PayloadStore> block (and its now-unused Microsoft.Extensions.DependencyInjection.Extensions using); the client Core PostConfigure still resolves PayloadStore from the shared/worker registration. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 3fbf061 commit 47651dc

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

src/Extensions/AzureBlobPayloads/DependencyInjection/DurableTaskClientBuilderExtensions.AzureBlobPayloads.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using Microsoft.DurableTask.Converters;
99
using Microsoft.DurableTask.Worker.Grpc.Internal;
1010
using Microsoft.Extensions.DependencyInjection;
11-
using Microsoft.Extensions.DependencyInjection.Extensions;
1211
using Microsoft.Extensions.Hosting;
1312
using Microsoft.Extensions.Logging;
1413
using Microsoft.Extensions.Options;
@@ -64,15 +63,6 @@ public static IDurableTaskClientBuilder UseExternalizedPayloads(
6463

6564
static IDurableTaskClientBuilder UseExternalizedPayloadsCore(IDurableTaskClientBuilder builder)
6665
{
67-
// Reuse the shared payload store when one is already registered (e.g. via AddExternalizedPayloadStore or
68-
// the worker builder in the same process); only register our own as a fallback so we never create a
69-
// second, redundant PayloadStore.
70-
builder.Services.TryAddSingleton<PayloadStore>(sp =>
71-
{
72-
LargePayloadStorageOptions opts = sp.GetRequiredService<IOptionsMonitor<LargePayloadStorageOptions>>().Get(builder.Name);
73-
return new BlobPayloadStore(opts);
74-
});
75-
7666
// Wrap the gRPC CallInvoker with our interceptor when using the gRPC client
7767
builder.Services
7868
.AddOptions<GrpcDurableTaskClientOptions>(builder.Name)

0 commit comments

Comments
 (0)