PowerShell / PowerShell/PowerShellEditorServices

Improve pipeline thread consumer task cancellation

Open
#1,594 0 comments 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

Because the pipeline thread consumer is single-threaded and runs tasks sequentially, there's the real possibility that a single bad task could starve it.

For now, Ctrl+C should cancel whatever task is running. This may indeed include background tasks...

But some ideas for improving this are:

  • A key-chord to cancel/unblock the pipeline thread when something other than console input is being run
  • A monitor thread to supervise the pipeline thread that:
    • Logs when tasks drag on
    • Alerts users to long running tasks
    • Allows cancellation
    • Can completely reset the main runspace...

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

No file, test, or entry point is named. Start by locating the pipeline thread consumer and tracing its existing Ctrl+C cancellation path; clarify which cancellation and monitoring behavior is required before changing it. Done should include an agreed approach for preventing a long-running task from starving the consumer.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.