generated from amazon-archives/__template_Apache-2.0
-
Couldn't load subscription status.
- Fork 33
Closed
Copy link
Labels
area/metricsCore metrics utilityCore metrics utilitybugUnexpected, reproducible and unintended software behaviourUnexpected, reproducible and unintended software behaviour
Description
Expected Behaviour
Metrics should be thread-safe and handle concurrent access without throwing exceptions.
Current Behaviour
-
Collection was modified; enumeration operation may not execute
- Occurs in LINQ
FirstOrDefaultoperations when metrics collections are modified concurrently - Stack trace points to
Metrics.csline 202-203 andMetricDirective.cs
- Occurs in LINQ
-
IndexOutOfRangeException: Index was outside the bounds of the array
- Occurs in
Dictionary.TryInsertduringAddMetadataoperations - Stack trace:
Metadata.cs:line 156inCustomMetadata.TryAdd(key, value)
- Occurs in
Code snippet
.Possible Solution
No response
Steps to Reproduce
The issue manifests when:
- Multiple threads simultaneously call
Metrics.AddMetric()andMetrics.AddMetadata() - High concurrency scenarios
Powertools for AWS Lambda (.NET) version
latest
AWS Lambda function runtime
dotnet8
Debugging logs
lachriz-aws
Metadata
Metadata
Assignees
Labels
area/metricsCore metrics utilityCore metrics utilitybugUnexpected, reproducible and unintended software behaviourUnexpected, reproducible and unintended software behaviour
Type
Projects
Status
✅ Done