-
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
Consider releasing #107333 into dotnet 9 #109060
Comments
Tagging subscribers to this area: @dotnet/area-system-diagnostics-activity |
@djluck the bar is really very high now. I'll check if this can be justified at the current stage of the release. Or maybe we can look having it in the service release. Could you please help answering the following questions: You said |
Thanks for the quick reply! In response:
We took traces of our application and saw excessive CPU due to lock contention in the exact function this PR addresses. I see no other mutex use within the start/ stop code path and so I believe it can only be the listener invocations. A sample trace we captured:
We're relatively new to tracing within our organization and have been increasing adoption within our large scale service over the last few months.
Is there a docker image available currently? One way I've been able to verify the lack of mutex impact is to create multiple
|
@djluck thanks for the info.
Could you try please reference the I'll wait your validation then I'll try to check if we can get the approval for 9.0. |
Thanks for giving me the pre release package feed, I've built a test version of our application with it and will test it tomorrow. |
Unfortunately the testing has hit a wall: we're seeing MissingMethodExceptions:
I'm not 100% why we're getting this:
It's possible it might be related to the fact we're targeting net 6.0 for our application? I haven't decompiled the netstandard2 versions of all the DLLs but there might be some differences here? |
This is very weird, and I have no idea how this happened. I downloaded the NET10 package Could you please try the recent version of the package from https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet10/NuGet/System.Diagnostics.DiagnosticSource/overview/10.0.0-alpha.1.24522.5? I confirmed this version doesn't have this problem. |
Thanks for digging in, I'll give that package a try 👍 |
Still seeing this fail with the same exception. Can reproduce in our tests. Decompiled the package and I can see the method in there and additional reflected on the type with this code to see the method:
|
I confirm the |
Sure: repro.zip |
I confirmed that when I target |
Thanks for trying that and sorry for the inconvenience. Will you be able to test the perf with that? |
Unfortunately not, we currently still target 6.0 for the majority of our applications. Upgrading to 8.0 will be a time consuming process that will involve many weeks (if not months) of testing. |
Ok, I'll look at your shared repro and try to find out what the problem is. In your project, you are targeting 6.0 but not referencing the specific version of |
I am referencing the specific version of
|
So far, I am seeing the problem is in the ns2.0 lib. I am trying to dig more to understand why that is. The diagnostic source package in net9 and net10 removed net6 target. which forcing using ns2.0 when targeting net6 and there the issue will show up. |
@ericstj helped explain the problem we are seeing. In short, the property I'll try to build you a private package based on net8.0 which still keeps net6 targeting. I'll share that with you when I have it ready. Thanks! |
System.Diagnostics.DiagnosticSource.8.0.1.nupkg.zip @djluck store the attached package to some local folder then rename it (remove the Aside from that, I have a question for you. If your app is targeting net 6.0 and you are requesting the fix to be included in net 9.0. Are you planning to migrate to 9.0 when it is released? |
Thanks, I will give that package a test.
My understanding is that |
The net9.0 package is not going to have net6.0 target. This means you'll end up with the same problem when falling back to ns2.0 one. |
Right, thanks for making that clear. But isn't this a violation of netstandard2 support? As System.Diagnostics.DiagnosticSource targets netstandard2 and net6.0 supports this, this seems like an error on the side of the package. |
No, net6.0 will be out of support by Nov 12th (the time of 9.0 release). This is why we removed the net6 assets from the package. This is why you will get a warning when using such package while targeting net6. |
I can't say I fully understand why this doesn't work with the netstandard2 targeted DLLs given .NET 6.0 supports netstandard2. But if this is by design, let me chase up people to try and understand if/ when we're upgrading to .NET 8. |
Using
Yes, as mentioned before, net6.0 is not going to be supported by the release of net9. When referencing this library package in net6, you'll get a compilation warning that this is not supported any more in net6. You have the option either to stick with the older version of the package and continue having the same behavior as before. Or you choose to upgrade to recent .NET versions and take advantage of all the new features and fixes in the newer library package. Let me know if there is anything unclear that I can help clarifying it. |
By the way, I appreciate if you continue trying the private package https://github.com/user-attachments/files/17512716/System.Diagnostics.DiagnosticSource.8.0.1.nupkg.zip in your scenario and report if it is fixing the issue you have. |
Hey @tarekgh, I tested the package successfully- we saw contention eliminated around When running a trace on another machine not running the fix, we see the high levels of contention around the When tracing a machine running the new |
@djluck thanks a lot for testing it out and sending the number. I'll look at and request porting the fix to the net9 first servicing release after the official release. From your side, please let us know if you can upgrade your .NET targeting and your time frame. I am asking because I am interested in helping you and resolving your issue. |
Thanks @tarekgh, appreciate all the timely help you've offered so far. I found out that we are already on net8.0 for one of our largest services and we're planning to migrate the rest Q1 2025. When would the 1st servicing release be due? |
Good to learn you are migrating to net8.
The exact timing is not decoded yet. My guess that it will be around Jan 2025. |
Thanks @tarekgh. Just to make sure I understand:
|
@djluck yes, your understanding is correct. |
@djluck the fix is now merged to the 9.0 servicing branch. Let me know if you have any questions, I can help with them. |
Thanks for the update @tarekgh! We'll keep an eye out for the servicing release. |
Thanks again for all your help getting to this point, really appreciate it. |
@tarekgh just to confirm, this isn't going to be part of the 9.0 RC that's currently available on nuget? This will only be released as part of the servicing release? |
You are correct. This fix will not show up till the first 9.0 servicing release. I'll expect the package version will be like |
We've been observing high lock contention in
ActivitySource
when it comes to publishing activity start/ stop notifications. #107333 fixes this issue but I'm unable to comment in this PR (it was locked).@tarekgh in that MR you outlined the higher threshold for merging this change into v9, citing impact. In our case we are seeing 10-20% of CPU time being contented in some of our high throughput services, contributing to severe latency spikes. Our hardware can have up to 192 cores which means we're far more likely to experience contention around a single shared mutex.
Hopefully this is data point is enough to consider merging this change into v9.
The text was updated successfully, but these errors were encountered: