try icon indicating copy to clipboard operation
try copied to clipboard

Page freeze. High cpu usage

Open damirdev opened this issue 5 years ago • 3 comments

Describe the bug

Please provide as much information as you can. Type program

using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;

public class Program
{
  public static async Task Main()
  {
    await new HttpClient().GetAsync("http://github.com/");
  }
}

Did this error occur while using dotnet try or online?

  • [ ] dotnet-try
  • [x] online

What kind of error was it?

  • [ ] User Interface (UI): For example the output never displayed
  • [ ] Service Error: For example "The service is temporarily unavailable. We are working on it"
  • [x] Other: Page freeze with high cpu usage tmp_1596115720314 tmp_1596115707099

Screenshots

If applicable, add screenshots to help explain your problem.

Please complete the following:

  • OS
    • [ ] Windows 10
    • [ ] macOS
    • [ ] Linux (Please specify distro)
    • [ ] iOS
    • [ ] Android
  • Browser
    • [x] Chrome
    • [ ] Edge
    • [ ] Safari

damirdev avatar Jul 30 '20 13:07 damirdev

It's a known limitation of this version that async/await will hang. We're hoping to fix this when we move to the GA release of Blazor WASM.

jonsequitur avatar Jul 30 '20 14:07 jonsequitur

See also: #242, #527.

jonsequitur avatar Jul 30 '20 14:07 jonsequitur

Still hangs, simpler to repro with Task.Delay, click to repro:

using System;
using System.Threading.Tasks;

public class Program
{
  public async static Task Main()
  {
    await Task.Delay(1000);
    Console.WriteLine("Hello after a delay!");
  }
}

noseratio avatar May 31 '21 23:05 noseratio