Skip to content

Fix deadlock in NativeRuntimeEventSourceTest #86370

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

Merged
merged 3 commits into from
May 18, 2023
Merged

Conversation

davmason
Copy link
Contributor

Fixes #86233

Copy link
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

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

The change looks fine. Given that this looks like a workaround, what meaning should I ascribe to the test failure? Is it a bug in the test, a bug in the product that we are choosing not to fix, a bug in the product that will be fixed later?

@BruceForstall
Copy link
Contributor

Build failed:

/__w/1/s/src/tests/tracing/runtimeeventsource/NativeRuntimeEventSourceTest.cs(27,34): error CS0103: The name 'ArrayPool' does not exist in the current context [/__w/1/s/src/tests/tracing/runtimeeventsource/nativeruntimeeventsource.csproj] [/__w/1/s/src/tests/build.proj]
##[error]src/tests/tracing/runtimeeventsource/NativeRuntimeEventSourceTest.cs(27,34): error CS0103: The name 'ArrayPool' does not exist in the current context [/__w/1/s/src/tests/tracing/runtimeeventsource/nativeruntimeeventsource.csproj]
/__w/1/s/src/tests/tracing/runtimeeventsource/NativeRuntimeEventSourceTest.cs(28,60): error CS1061: 'byte[]' does not contain a definition for 'Lenth' and no accessible extension method 'Lenth' accepting a first argument of type 'byte[]' could be found (are you missing a using directive or an assembly reference?) [/__w/1/s/src/tests/tracing/runtimeeventsource/nativeruntimeeventsource.csproj] [/__w/1/s/src/tests/build.proj]
##[error]src/tests/tracing/runtimeeventsource/NativeRuntimeEventSourceTest.cs(28,60): error CS1061: 'byte[]' does not contain a definition for 'Lenth' and no accessible extension method 'Lenth' accepting a first argument of type 'byte[]' could be found (are you missing a using directive or an assembly reference?) [/__w/1/s/src/tests/tracing/runtimeeventsource/nativeruntimeeventsource.csproj]

@davmason
Copy link
Contributor Author

Given that this looks like a workaround, what meaning should I ascribe to the test failure? Is it a bug in the test, a bug in the product that we are choosing not to fix, a bug in the product that will be fixed later?

It's a bug in the product, but I don't think customers are likely to hit it. There is a potential deadlock between shutting down EventPipeEventDispatcher and an EventListener if you create EventSources in your OnEventWritten callback. I don't think this is a common scenario, we are particularly vulnerable to it in the tests because they are short lived and only write an event or two, and touching framework code can cause EventSources like ArrayPoolEventSource to be lazy initted.

To my knowledge we haven't had customer reports, because their EventListeners are generally longer lived.

@noahfalk
Copy link
Member

noahfalk commented May 17, 2023

I'd suggest you add a comment to the test code saying that we believe a product issue exists here, but for now we are choosing not to fix it because we believe it doesn't impact any customers. Thanks David!

@davmason davmason merged commit 4db4bb5 into dotnet:main May 18, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jun 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test failure tracing/runtimeeventsource/nativeruntimeeventsource/nativeruntimeeventsource.sh
3 participants