PowerShell / PowerShell/PowerShellEditorServices

Verify the main runspace reset method in the PSES pipeline thread consumer

Open
#1,595 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Engine Area-Threading Issue-Bug
Dominant language
C#
Stars
767
Forks
266
Avg merge
3d 16h
Merged PRs (30d)
1

Description

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...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs around lines 784-826, then trace the pipeline thread consumer and its runspace state handling. Induce the faulty runspace condition described in the issue and verify detection, restoration, and that the reset does not run during normal operation; done means the behavior is confirmed or the needed refinements are documented and tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.