Skip to content

OFS isn't safe for multi-process/thread access #11

@rossjones

Description

@rossjones

The persisting of state in https://github.com/okfn/ofs/blob/master/ofs/local/storedjson.py#L12 has been causing issues where the file will be corrupted, or overwritten with incorrect data by another process. There is nothing stopping one process/thread from writing to the file whilst another process is also trying to write (there is a race between reading/writing).

State should be persisted somewhere other than a file on disk. Setting O_EXCL on the fd isn't a safe solution (it'll just show up as blocked/sleeping processes waiting for access).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions