Skip to content

semaphore / concurrency #54

Description

@michielbdejong

php-solid-server is failing the new concurrency tests that were added in solid-crud-tests v5.1.0.

What these tests do is send 10 PUT requests for the same resource at the same time, with If-None-Match: * header.
This means only 1 of them should return a 201 and the other 9 should return 412 Precondition Failed.

Looking at the code, it does a has check first and then a write. Does FlySystem support something like an atomic WriteIfNotExists or something like Lock?

Activity

  1. michielbdejong commented on Nov 24, 2021

    @michielbdejong
    MemberAuthor
  2. Potherca commented on Nov 25, 2021

    @Potherca
    Member

    There is the ability to use locks with the Local adapter which is what we currently use.

    That might cause problems later, if/when we ever decide to (also?) support other adapters, but for now it should not cause trouble...

    Hmmm... It says "By default this adapter uses a lock during writes and updates", which means that's not what we're looking for.

  3. Potherca commented on Nov 25, 2021

    @Potherca
    Member

    Looks like we are still using FlySystem v1, which does seem to have a put method. In v2, this has been changed to deterministic writes. We might be able to change the logic as to not use has and allow FlySystem to handle the fallout? 🤔 Still feel like I'm missing something, though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions