Skip to content

9.43.0

Choose a tag to compare

@jeremydmiller jeremydmiller released this 11 Oct 21:16
· 200 commits to master since this release
43212d9

One change: the SQL Server advisory lock monitor that 9.42 added becomes configurable.

Full upgrade guide: https://weasel.jasperfx.net/release-9-43

Nothing in this release is a breaking change, and nothing behaves differently unless you ask it to. The new settings default to 9.42.0's hard-coded values exactly, and the existing three-argument constructor keeps its signature.

SQL Server advisory lock monitor is configurable: #700 / #701

var advisoryLock = new AdvisoryLock(source, logger, databaseName, new SqlServerAdvisoryLockOptions
{
    MonitoringInterval = 10.Seconds(),   // default 5s
    ProbeTimeout = 3.Seconds()           // default 5s; keep it under the interval
});
  • ⚠️ A non-positive or infinite MonitoringInterval turns the monitor off, which re-opens 9.42's split brain (#695): a node that loses its session goes on reporting locks the server has already released. The probe costs nothing while no locks are held, so opting out only saves one parked timer per database.
  • ProbeTimeout bounds shutdown as well as the query, because disposal waits behind an in-flight probe. Sub-second values round up to one second, since CommandTimeout = 0 would mean "wait forever".
  • There is no ReleaseTimeout, unlike the PostgreSQL lock. A pooled SqlConnection keeps its session and its sp_getapplock holds when it closes, so a release abandoned on a deadline would strand the lock against the next node. This was measured and is pinned by tests.

Polecat users set this through Polecat's own options (JasperFx/polecat#749), not by constructing the lock directly.

New public API

  • Weasel.SqlServer.SqlServerAdvisoryLockOptions
  • AdvisoryLock(Func<SqlConnection>, ILogger, string, SqlServerAdvisoryLockOptions)