Skip to content

Make cache thread-safe #2153

@auguste-probabl

Description

@auguste-probabl

Is your feature request related to a problem? Please describe.

We are currently delegating adding keys to the cache to the callers:

https://github.com/probabl-ai/skore/blob/9bae5d2ee9ce212add2fb6b35514e5020148912a/skore/src/skore/_sklearn/_base.py#L337-L341

This makes skore code more complex as callers have to know about this peculiarity of the cache.

Describe the solution you'd like

The current code is a quick fix to preserve thread-safety. We should rework the caching mechanism to make it thread-safe, and move back all the adding keys logic into the cache module.

Describe alternatives you've considered, if relevant

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature 🎁Feature or enhancementneeds API design 🎨Requires public/private API design before implementation

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions