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

[release/9.0-staging] Remove HttpMetricsEnrichmentContext caching #110626

Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Dec 11, 2024

Backport of #110580 to release/9.0-staging

Fixed in #108284

/cc @MihaZupan

Customer Impact

Reported by 6 customers in the issue #108284.

HttpMetricsEnrichmentContext is a feature added in .NET 8.0 that allows the user to provide extra information during HTTP metrics collection.
A bug in the implementation results in certain valid usage patterns, such as request retries (e.g. using Polly), to corrupt global state, leading to reliability issues for the remainder of the process lifetime.
The user may experience corrupted (e.g. missing or duplicate) metrics information, and their requests may randomly fail with unforseen exceptions (NullReferenceException, InvalidOperationExceptions).

Regression

No - The issue was present in the initial implementation of the new feature in .NET 8.0.

Testing

Targeted tests were added that exercise the impacted scenario where request objects are reused.

Risk

Low.
The change is limited to the HttpMetricsEnrichmentContext type and thus the impact is limited to uses of this feature.
Without the fixes, the feature is already unreliable in common usage scenarios (e.g. using Polly for request retries).

Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

@karelz
Copy link
Member

karelz commented Dec 19, 2024

Reliability issue, impacting higher number of customers. We should fix it in both 9.0.x and 8.0.x. Maring for servicing.

@karelz karelz added the Servicing-consider Issue for next servicing release review label Dec 19, 2024
@MihaZupan MihaZupan added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jan 8, 2025
@MihaZupan
Copy link
Member

Servicing approved by Steve Carroll on Jan 8th via email.

@MihaZupan MihaZupan merged commit f2b4741 into release/9.0-staging Jan 8, 2025
84 checks passed
@jkotas jkotas deleted the backport/pr-110580-to-release/9.0-staging branch January 8, 2025 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Net.Http Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants