Skip to content

Calling is_file_open degrades current query to durability LOW #114

@MichaReiser

Description

@MichaReiser

We noticed in astral-sh/ruff#17463 (comment) that calling is_file_open degrades the durability of otherwise MEDIUM or HIGH durability queries to LOW because the Project::open_files_set and Project::files fields have durability LOW.

What this means is that we degrade the durability of type inference and semantic index queries to LOW if they have any type checking or semantic syntax errors. Which is unfortunate, because it requires that Salsa can't use the fast-path to mark the queries as "up-to-date" after a revision change.

To some extend, this problem is similar to the one we experienced in the module resolver where module resolution first tries first-party files (that have a low durability) and only then tests for third party files.

The easiest solution is to change is_file_open to early return for vendored paths and system paths that aren't subpaths of the project directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePotential performance improvement

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions