Stop Execution button does not stop the infinite for loop
Describe the bug
The Stop Execution button on polyglot notebook doesn't stop the execution of an infinite for loop such as:
for ( ; ; )
{
//...
}
My current workaround to stop an infinite for loop is to restart the kernel, although sometimes, the Stop Execution does stop an infinite for loop or execution of a cell
Please complete the following:
Which version of .NET Interactive are you using? (In a notebook, run the #!about magic command. ):
- OS
- [x] Windows 11
- [ ] Windows 10
- [ ] macOS
- [ ] Linux (Please specify distro)
- [ ] iOS
- [ ] Android
- Browser
- [ ] Chrome
- [x] Edge
- [ ] Firefox
- [ ] Safari
- Frontend
- [ ] Jupyter Notebook
- [ ] Jupyter Lab
- [ ] nteract
- [x] Visual Studio Code
- [ ] Visual Studio Code Insiders
- [ ] Visual Studio
- [ ] Other (please specify)
Screenshots
The cancel button will not cancel infinite loops, since .NET Core / .NET 5 / .NET 6 did not support an equivalent of .NET Framework's Thread.Abort. We are working on a potential fix using the ControlledExecution API introduced in .NET 7.
Related: #3049.
Thanks for the clarification! It would be helpful if I can cancel infinite loops as sometimes, I create infinite loops by mistake and for now, I can only stop those infinite loops by restarting the kernel, affect other cells as well.
Looking forward to the fix and appreciate the prompt response!