[release/9.0] Root the System.Runtime EventSource#108348
Merged
jeffschwMSFT merged 2 commits intorelease/9.0from Sep 30, 2024
Merged
[release/9.0] Root the System.Runtime EventSource#108348jeffschwMSFT merged 2 commits intorelease/9.0from
jeffschwMSFT merged 2 commits intorelease/9.0from
Conversation
The System.Runtime EventSource (RuntimeEventSource), was unintentionally being garbage collected because it wasn't rooted. This caused runtime EventCounters to no longer be available after GC occurred. This was a regression from a recent change (#106014). That change accidentally converted the static field that was intended to the root the object into a property getter that returned a new instance each time it was called. This fix converts the property back into a statically initialized field. This will fix #107919 once it is backported.
tarekgh
approved these changes
Sep 27, 2024
Member
jkotas
approved these changes
Sep 27, 2024
jeffschwMSFT
approved these changes
Sep 27, 2024
Member
jeffschwMSFT
left a comment
There was a problem hiding this comment.
lgtm. we will take for consideration in 9 GA
Contributor
|
Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti |
tommcdon
approved these changes
Sep 27, 2024
artl93
approved these changes
Sep 27, 2024
3 tasks
stoyanov-x
approved these changes
Sep 29, 2024
Member
|
/ba-g no real failure in the build analysis. The CI just skipped one leg. |
Member
|
Could someone have permission help merge this PR? Thanks! |
Member
I believe @jeffschwMSFT has merge permissions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Backport of #108266 to release/9.0
/cc @noahfalk
Customer Impact
Starting in RC1 runtime metrics available via dotnet-counters, dotnet-monitor, Visual Studio and potentially other tools were missing if the tool wasn't started quickly after app startup. Once the metrics were missing they are unrecoverable for the remainder of the process lifetime.
The underlying cause is that the RuntimeEventSource object which provides the counters was being garbage collected because it isn't properly rooted. The timing on how quickly the counters go away depend on how quickly the GC runs.
Regression
Regressed starting in RC1, caused by #106014
Testing
I manually tested the change using the repro provided in the issue report.
Risk
Low - the change restores behavior that was present before the regression, its a tiny code change that is easy to reason about, and its been tested.