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] Fix deadlock in EventPipeEventDispatcher #92912

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 2, 2023

Backport of #92806 to release/8.0

/cc @tommcdon @davmason

Customer Impact

Fixes a deadlock issue #92236 caught in CI.

Taking m_dispatchControlLock around the call to EventPipeInternal.Disable leads to a potential deadlock where one thread is holding the EventListenersLock and trying to get m_dispatchControlLock and the disable thread is holding m_dispatchControlLock and trying to get EventListenersLock as part of handling the disable command.

This switches to using volatile reads and writes (just for the observability part) to make the dispatch loop wait until SignalSession has been called before calling in to Disable

Testing

Validated eventpipe test no longer hangs

Risk

Low

Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved. we will take for consideration in 8.0.x

@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Oct 3, 2023
@rbhanda rbhanda added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Oct 3, 2023
@carlossanlop
Copy link
Member

CI failure is unrelated. Not sure why KnownBuildError did not link it: #92944

@carlossanlop carlossanlop merged commit 937cfcd into release/8.0 Oct 3, 2023
171 of 177 checks passed
@carlossanlop carlossanlop deleted the backport/pr-92806-to-release/8.0 branch October 3, 2023 19:45
@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Tracing-coreclr Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants