Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race-free Preconditions #935

Merged
merged 5 commits into from
Oct 31, 2022
Merged

Race-free Preconditions #935

merged 5 commits into from
Oct 31, 2022

Commits on Oct 31, 2022

  1. upload_test: Add UploadRacesAreOnlyWonByOne

    This tests for race-conditions in Conditional uploads, by repeatedly
    uploading to the same object from multiple go-routines, and verify that
    only one succeeded.
    rawler committed Oct 31, 2022
    Configuration menu
    Copy the full SHA
    4c29f59 View commit details
    Browse the repository at this point in the history
  2. backend/storage:Add Conditions to CreateObject

    Move the "Preconditions"-checking into the backend, to be done under the
    protection of the backend mutex. This enables `DoesNotExist`-behavior to be
    implemented race-free
    rawler committed Oct 31, 2022
    Configuration menu
    Copy the full SHA
    f2eaa70 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    23d566e View commit details
    Browse the repository at this point in the history
  4. Apply suggestions from review

    Co-authored-by: fsouza <[email protected]>
    rawler and fsouza committed Oct 31, 2022
    Configuration menu
    Copy the full SHA
    5ec4d7a View commit details
    Browse the repository at this point in the history
  5. upload_test:Use runServersTest in ...RacesAreOnlyWonByOne

    While potentially a problem for test-performance, speed of running tests
    are currently bearable on my machine
    
    ok  	github.com/fsouza/fake-gcs-server	0.016s
    ok  	github.com/fsouza/fake-gcs-server/fakestorage	1.176s
    ok  	github.com/fsouza/fake-gcs-server/internal/backend	0.031s
    ok  	github.com/fsouza/fake-gcs-server/internal/checksum	0.010s
    ok  	github.com/fsouza/fake-gcs-server/internal/config	0.010s
    ok  	github.com/fsouza/fake-gcs-server/internal/notification	0.026s
    rawler committed Oct 31, 2022
    Configuration menu
    Copy the full SHA
    4aba11a View commit details
    Browse the repository at this point in the history