Loading Consul Key Value Pair as ServiceConfiguration in Asp.net 6 as I Configuration hangs up for 7 ~ 10 minutes .
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 39
Description
#### Overview of the Issue
IConfiguration in Asp.net 6 hangs up for about 10 minutes when trying to get the current value of the Custom Service Configuration. We are using the Key Value pair for our configuration files which are json and when ASP.Net tries to pick the value for the same it takes a lot of CPU, MEMORY, and TIME which hangs up the app for about 10 minutes.
#### Reproduction Steps
Steps to reproduce this issue, e.g.:
1. Create a ASP .net Application and use IConfiguration for CustomConfiguration.
2. Add Consul as Configuration provider to load the values from Custom Path in Consul .
3. Deploy Consul locally with docker and Run and create **8000 JSON** files in the path defined in step two.
4 . FYI the Service Configuration is Custom class deserialized as Dictionary , and further down the line as follows :
**NOTE : The same configuration is not important , Number of files are important .**
```
public class ServiceConfiguration : Dictionary
{
public ServiceConfiguration() : base(StringComparer.OrdinalIgnoreCase)
{
}
}
```
```
public class ClassA : Dictionary
{
public ClassA() : base(StringComparer.OrdinalIgnoreCase)
, {
}
}
```
```
public class ClassB
{
public FinalNestedClassConfigurationC FinalNestedClassC { get; set; } =
new LicensePlateNumberValidationConfiguration();
public FinalNestedClassConfigurationD FinalNestedClassD { get; set; } = new FinalNestedClassConfigurationD();
public FinalNestedClassConfigurationE FinalNestedClassE { get; set; } = new FinalNestedClassConfigurationE();
public FinalNestedClassConfigurationF FinalNestedClassF { get; set; } = new FinalNestedClassConfigurationF();
public FinalNestedClassConfigurationG FinalNestedClassG { get; set; } = new FinalNestedClassConfigurationG();
public static FinalNestedClassConfigurationC Default { get; } = new FinalNestedClassConfigurationC();
}
```
Contributor guide
Research direction
No repository file, test, or entry point is named. Start by reproducing the ASP.NET 6 configuration load with Consul running in Docker and 8,000 JSON files, then trace the custom configuration provider and dictionary deserialization path. Done means the excessive CPU, memory use, and 7–10 minute startup delay are explained and addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, docker
- Domain
- backend, devops, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100