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/8.0-staging] Fixes deadlock for IncrementingPollingCounter callbacks #108648

Merged
merged 1 commit into from
Oct 11, 2024

Commits on Oct 8, 2024

  1. Fixes deadlock for IncrementingPollingCounter callbacks

    This is a modified backport of dotnet#105548. It mostly preserves the logic of the original fix in .NET 9 with a few adjustments:
    - Added a config switch System.Diagnostics.Tracing.CounterCallbackOnTimerThread that must be set to true to opt-in to the fix behavior. The .NET 9 fix
      was documented as a breaking change because it slighly modifies the timing and thread used for first call to an IncrementingPollingCounter callback. I did not want anyone in 8.0 to opted into this by default.
    - The opt-in switch sets the property CounterCallbackOnTimerThread and I added this condition to several of the if checks in the code. Its more than would be strictly necessary just to make it obvious when code reviewing individual methods that the new code paths are unreachable unless the app opts in.
    - The original 9.0 change had a bit more refactoring that wasn't essential (renaming a method, removing an unneeded lock() scope) and I removed that here to reduce the code delta.
    noahfalk committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    e5a9053 View commit details
    Browse the repository at this point in the history