Prevent lock collision with application level Postgres advisory lock usage and other libraries.
Use pg_try_advisory_lock(key1 int, key2 int) instead of pg_try_advisory_lock(key bigint).
See this commit to Oban for an example implementation which uses the identity of a table to namespace advisory locks. For EventStore we should use the subscriptions table identity as the namespace.
Prevent lock collision with application level Postgres advisory lock usage and other libraries.
Use
pg_try_advisory_lock(key1 int, key2 int)
instead ofpg_try_advisory_lock(key bigint)
.See this commit to Oban for an example implementation which uses the identity of a table to namespace advisory locks. For EventStore we should use the
subscriptions
table identity as the namespace.