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

Fix sqlserver lock #1123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

d10i
Copy link

@d10i d10i commented Aug 2, 2024

Problem

When acquiring the sqlserver lock, it fails immediately if the lock can't be acquired. When running multiple migrations concurrently, only one of them will succeed and the other ones will fail.

Solution

Wait for up to 10 seconds when acquiring the lock. This way it lets the other entity that has acquired the lock do its job first. This is consistent with what this library does for postgres (though it waits indefinitely) and for mysql.

Fixes #253

When acquiring the `sqlserver` lock, it fails immediately if the lock
can't be acquired. When running multiple migrations concurrently, only
one of them will succeed and the other ones will fail.

Wait for up to 10 seconds when acquiring the lock. This way it lets the
other entity that has acquired the lock do its job first. This is
consistent with what this library does for `postgres` (though it waits
indefinitely) and for `mysql`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SQL Server Driver Attempts to Release Nonexistent Locks
1 participant