-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Eventpipe block unregister for callbacks #105734
Eventpipe block unregister for callbacks #105734
Conversation
bbf9d70
to
9e7c9ec
Compare
Introduce a new CrstType to add a new CrstStatic lock in EventPipe. The new lock specifically aims to match EventPipe behavior with ETW, by blocking EventPipe's EventProvider Disposal until in flight callbacks complete.
9e7c9ec
to
0733de8
Compare
0733de8
to
b862d5b
Compare
This PR attempted to fix #80666 by adding a new lock to help coordinate provider deletion while in-flight callbacks were running. This PR tried to add new lock since the global eventpipe config lock Since there is a callback might be able to callback into various eventpipe functions, the global eventpipe config lock might be acquired during the callback, so the convention for using the new lock would be to always acquire the new lock before acquiring the global eventpipe config lock, to prevent deadlocks. However, after implementing the new lock, we discovered a deadlock between this new eventpipe callback_dispatch lock and the EventListenersLock. It looks like by adding this new lock to coordinate Deadlock scenariocallback_dispatch lock held -> try to acquire EventListenersLock in EventSource::SendCommand
EventListenersLock held -> try to acquire eventpipe callback_dispatch lock by invoking callback
|
Fixes #80666