migrate icon indicating copy to clipboard operation
migrate copied to clipboard

Fix sqlserver lock

Open d10i opened this issue 6 months ago • 0 comments

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 https://github.com/golang-migrate/migrate/issues/253

d10i avatar Aug 02 '24 09:08 d10i