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

Retry after race during schema creation in database backend #6298

Merged
merged 3 commits into from Sep 30, 2020

Commits on Sep 29, 2020

  1. Retry after race during schema creation in database backend

    Fixes celery#6296
    
    This race condition does not commonly present, since the schema creation
    only needs to happen once per database. It's more likely to appear in
    e.g. a test suite that uses a new database each time.
    
    For context of the sleep times I chose, the schema creation takes ~50 ms
    on my laptop.
    
    I did a simulated test run of 50 concurrent calls to MetaData.create_all
    repeated 200 times and the number of retries was:
    
    - 0 retries: 8717x
    - 1 retry:   1279x
    - 2 retries  4x
    RazerM committed Sep 29, 2020
    Copy the full SHA
    3d85b3c View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    787fb82 View commit details
    Browse the repository at this point in the history
  3. Add name to contributors

    RazerM committed Sep 29, 2020
    Copy the full SHA
    9501587 View commit details
    Browse the repository at this point in the history