[5.0.2] Fix event counter issues #23616
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #23630
Description
Three event counters don't get updated when the async API is used (as opposed to the sync one). An additional event counter is incorrectly updated, and so show wrong results.
Customer Impact
Our newly-introduced event counters show incorrect data which does not take into account async calls.
How found
Customer reported an issue on 5.0.0 with one counter, the rest discovered via due diligence.
Test coverage
As far as I can tell, event counters don't currently have test coverage in any of our projects (EF Core, ASP.NET, runtime). Their nature makes it difficult to write reliable, non-flaky tests.
Regression?
No, event counters are new in 5.0.0.
Risk
Very low, add missing counter updates which are already in place and working for the sync versions, and move the location of another counter update. Only affects the new event counters feature.