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

Fix EventSource shutdown deadlock #56453

Merged
merged 1 commit into from
Jul 29, 2021
Merged

Commits on Jul 28, 2021

  1. Fix EventSource shutdown deadlock

    Fixes dotnet#48342
    
    A deadlock was occuring because we held the EventListenersLock
    while calling into EventUnregister which will take ETW's own native
    lock. In the case of ETW sending an enable/disable notification
    these locks are taken in reverse order which triggers a deadlock.
    
    The fix is to ensure that we always order the locks so that any code
    path taking both locks always takes the ETW lock first. In this case
    it meant accumulating the list of event sources to dispose under
    the lock but then exiting the lock prior to calling Dispose() which
    will eventually call EventUnregister.
    noahfalk committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    89f086a View commit details
    Browse the repository at this point in the history