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
Named pipe connection code needs to not busy wait #10413
Comments
Perhaps we should also consider a reflection call to the async API if it's available? When we kick 4.5 support to the curb we can then just always use the async API. We'll still need the |
|
/cc @stephentoub |
Hey, all! Just wanted to pop in with a little background info. This is related to an issue running Roslyn in ASP.NET on Azure Websites for C# 6.0 features. Had to uninstall the package from production because that 14 second spin-up was affecting our users. Someone else experienced the same issue and posted about it on StackOverflow. Thanks for your help, and looking forward to a fix! :) |
Note that NamedPipeClientStream in corefx already uses SpinWait: cc: @ianhays |
It's on .NET Framework, not .NET Core. |
Indeed it's on .NET Framework. Even if we ported the fix there it wouldn't help because this particular scenario, Roslyn + legacy ASP.Net pages, must work on .NET 4.5. |
On .NET 4.5 the implementation for NamedPipeClientStream busy waits during the timeout period, blocking the running CPU. Fixes dotnet#10413.
On .NET 4.5 the implementation for NamedPipeClientStream busy waits during the timeout period, blocking the running CPU. Fixes #10413.
Closed by #11709 |
The API
NamedPipeClientStream::Connect
has a busy wait algorithm with no back off semantics. This can create a huge lag in our standard server compilation scenario on a single core machine:NamedPipeClientStream::Connect
.Unfortunately on a single core machine the
Connect
loop can dominate and cause the server to take ~14 seconds to actually start up and process the connection. Need to callConnect
with a small timeout here and do aSpinWait
to make it less busy.The text was updated successfully, but these errors were encountered: