Skip to content

Concurrent uploads of the same file can cause intermittent 500 responses #128

@peter-esik

Description

@peter-esik

When concurrent upload requests of the same blob are issued to an lfs-test-server instance, sometimes an HTTP status of 500 is returned with a response body such as this:

{"message":"open lfs-content/4c/d3/7f1a69b723d958eff48fd27495c05d13c8bc91693f1bd7f2b44239a3d9cb.tmp: file exists"}

Here's a Python script for repro'ing the problem: https://gist.github.com/peter-esik/b0057ecca6890463b4a113771b15bae9

This can happen in legitimate use cases, such as the following:

  • user A and B both add a commit containing an LFS-tracked file with identical content (unknowingly)
  • they push their changes at the ~same time

There's a chance that one of them will receive an error. It's quite benign, as if they try to push again, it will succeed.

I'm not sure how relevant this issue is, but I felt like reporting it, so if someone encounters this in the future, this issue can provide more information.

I ran the repro script against rudolfs and giftless, and experienced no issues (I did not check whether the uploaded blobs were garbled or not due to a potential race condition, though...).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions