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

Run solid_queue with SQLite #29

Merged
merged 1 commit into from
Nov 1, 2023
Merged

Run solid_queue with SQLite #29

merged 1 commit into from
Nov 1, 2023

Commits on Oct 16, 2023

  1. Run solid_queue with SQLite

    Update the tests to run solid_queue on SQLite.
    
    They can be triggered by:
    ```
    TARGET_DB=sqlite rails test
    ```
    
    The adapter is prone to raising `SQLite3::BusyException`s when
    concurrent transactions occur. Preventing this requires a couple of
    patches to the adapter.
    
    1. Implement retry with backoff - add a `retries` config setting
    to the adapter and sleep progressively longer for each retry. This
    setting is currently in the Rails main branch, but that implementation
    has no backoff. That doesn't work well in our case.
    1. Always create immediate transactions - SQLite by default creates
    deferred transactions, which don't take a write lock. Then later if
    there is a write it tries to upgrade the lock. This won't work if the
    transaction has a stale read so retrying the write by itself is not
    possible. Starting with an immediate transaction moves the write lock to
    that point and ensures that we only get blocked on a retryable
    transaction.
    djmb committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    08f5725 View commit details
    Browse the repository at this point in the history