PowerShellEditorServices
PowerShellEditorServices copied to clipboard
Verify the main runspace reset method in the PSES pipeline thread consumer
We have a kind of primitive stab at a method to clean up a faulty runspace state in the PSES pipeline thread consumer here:
https://github.com/PowerShell/PowerShellEditorServices/blob/9fd0dfa58438a9ba2b2d3cdfe22cd9cad5df70b0/src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs#L784-L826
We need to induce a fault and see if this works as expected, as well as ensure it doesn't run at other times...
My suspicion is that it will need some refinement and could have some significant bugs in it. But it's currently a corner case and a worse-case scenario handler anyway (if it didn't exist, we are essentially crashed).
So we need to investigate this and see how we can improve:
- detection of bad runspace state
- restoration of good runspace state
- how our threading mechanisms work in this scenario...
We should consider this for telemetry. @StevenBucher98