microsoft / microsoft/component-detection

Change python detectors cache implementation

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

Nobody has claimed this yet.

detector:pip type:refactor
Dominant language
C#
Stars
553
Forks
135
Avg merge
20h 58m
Merged PRs (30d)
6

Description

Currently, the Python client that the detectors use cache the whole response, which leads to OOM when the whl files are big.
First, I think the cache should be in the PythonResolver level and not in the client and cache Uri to HashSet of the dependencies.
Also, I think the cache should be changed to IMemoryCache instead of an actual MemoryCache instance.

AB#2098100

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 by locating PythonResolver and the Python detector client, then trace where the full response is cached and inspect the cache type used there. Done means caching is owned by PythonResolver, stores each Uri to its dependency HashSet rather than the whole response, and uses IMemoryCache; verify behavior with the existing detector tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, python
Domain
performance, tooling
Issue type
Refactor
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.