Skip to content

Fog::Local::File not safe for concurrent use #5

Open
@plribeiro3000

Description

@plribeiro3000

Hi, we've run in to issues using Fog as a local blobstore from multiple concurrent clients. Specifically the .save method creates parent directories (ab/cd/abcd-efgh-ijkl) only if they don't exist before the file is saved. This is fine, but if another file with the same first four characters in its key is being deleted at the same time those directories can get deleted before the actual save happens. When this occurs we get an ENOENT - No such file or directory error (and it does seem to occur reasonably frequently under real load).

I'm not sure whether Local::File is supposed to be thread-safe or to work for concurrent access from more than one process, or whether we should expect to have to work around these issues at a higher level. Please let us know if you think you would accept a PR to fix the code here to be resilient to concurrent deletes and saves. Thanks!

Original issue made by @julz at fog/fog#3137

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions