dotnet / interactive

.NET Interactive combines the power of .NET with many other languages to create notebooks, REPLs, and embedded coding experiences. Share code, explore data, write, and learn across your apps in ways you couldn't before.
MIT License
2.88k stars 382 forks source link

CPU spinning on windows #3459

Open BrennanConroy opened 7 months ago

BrennanConroy commented 7 months ago

Describe the bug

Process is spinning forever in https://github.com/dotnet/interactive/blob/0e90328dd36e15ea60f8c3959f93369fde9db670/src/Microsoft.DotNet.Interactive/Connection/KernelCommandAndEventReceiver.cs#L80

Please complete the following:

Which version of .NET Interactive are you using? (In a notebook, run the #!about magic command. ):

Memory Dump

Available offline ping me on Teams, file is 541MB and GitHub only allows 25MB.

BrennanConroy commented 7 months ago

Well one issue is that you're ignoring null values from ReadLine and continuing the loop. A null value means the stream has reaching EOF. https://source.dot.net/#System.Private.CoreLib/src/libraries/System.Private.CoreLib/src/System/IO/StreamReader.cs,793