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

Streaming configuration - updates are not propagated #934

Closed
tomhreb opened this issue Aug 22, 2022 · 1 comment
Closed

Streaming configuration - updates are not propagated #934

tomhreb opened this issue Aug 22, 2022 · 1 comment
Assignees
Labels
Milestone

Comments

@tomhreb
Copy link
Contributor

tomhreb commented Aug 22, 2022

Expected Behavior

Using IOptionsMonitor I can receive updates from dapr configuration store.

Actual Behavior

I am not receiving updates from the configuration store.

Steps to Reproduce the Problem

This can be reproduced using minimal api app

Project file

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.8" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\src\Dapr.Extensions.Configuration\Dapr.Extensions.Configuration.csproj" />
  </ItemGroup>

</Project>

Program.cs

using Dapr.Client;
using Dapr.Extensions.Configuration;
using Microsoft.Extensions.Options;

var client = new DaprClientBuilder().Build();
var builder = WebApplication.CreateBuilder(args);
var services = builder.Services;
var configuration = builder.Configuration;

configuration.AddDaprConfigurationStore("redisConfig", new List<string> { "version" }, client, TimeSpan.FromSeconds(20));
configuration.AddStreamingDaprConfigurationStore("redisConfig", new List<string> { "version" }, client, TimeSpan.FromSeconds(20));

services.Configure<MyOptions>(builder.Configuration);
var app = builder.Build();

app.MapGet("/", context =>
{
    var config = context.RequestServices.GetRequiredService<IOptionsMonitor<MyOptions>>();

    return context.Response.WriteAsJsonAsync(config.CurrentValue.Version);
});

app.Run();

class MyOptions
{
    public string Version { get; set; }
}

By periodically quering this endpoint while updating the key in redis, the response shculd report updated value, which is not happening and the first value is reported.

EDIT: I've found the root cause and created #935


RELEASE NOTE: Fixed `DaprConfigurationStoreProvider` not applying case-insensitive configuration updates correctly.
@tomhreb tomhreb added the kind/bug Something isn't working label Aug 22, 2022
@WhitWaldo WhitWaldo added this to the v1.15 milestone Nov 30, 2024
@WhitWaldo
Copy link
Contributor

Closing this issue as the bugfix has been merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants