microsoft / microsoft/vscode-windows-process-tree

Invocations to `getProcessTree`/`getProcessList` with different flags are confused

Open
#50 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
94
Forks
29
Avg merge
2d 13h
Merged PRs (30d)
4

Description

Related to (but neither caused nor fixed by): https://github.com/microsoft/vscode-windows-process-tree/pull/46.

Filing because I noticed the issue by inspection, not from a particular known defect.

Basically, because of the gating to native.getProcessList, if one invocation is called with one set of flags, and then with another is made before the first returns, the second invocation will get results from the wrong flags. This could confuse code in cases where e.g. you requested memory info and occasionally do not receive it seemingly randomly.

Instead, there should probably be logic along the lines of:

  • different queues for different sets of flags
  • on completion of an invocation, callbacks run for all queues with fully-satisfied flags
  • if there are queued requests for additional flags, re-run with those flags immediately

Or something like that. Or just always run with all the flags, unless there's a performance reason not to.

Contributor guide

No contributing guide indexed for this repository

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 by tracing getProcessTree and getProcessList through the gating around native.getProcessList, focusing on how concurrent invocations and their flags are queued. Confirm the behavior with overlapping requests using different flags; done means each invocation receives results satisfying its own flags, including memory information when requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.