Skip to content

The new SeparateBodyFileCache design makes updates/reads non-atomic #324

Open
@itamarst

Description

@itamarst

The problem

Scenario 1

Program crashes after writing metadata but before writing body. Now the cache thinks the body is empty.

Scenario 2

Multiple processes using the same cache directory. Process A writes metadata, but not yet body. Process B gets metadata, then gets body, and now it thinks the body is empty.

Workarounds

For pip I added logic that basically pretends a cache entry is missing if it doesn't have both body and metadata files.

Solutions

Probably need both a new API that involves writing and reading both at once, and an implementation that makes sure that's atomic. See also the somewhat related #325.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions