Skip to content

fix: avoid pinning clients on failed advisory try locks (#1579 on v0.1.60) - #1

Merged
ewhauser merged 1 commit into
cadence/v0.1.60from
cadence/v0.1.60-1579
Oct 3, 2026
Merged

ewhauser merged 1 commit into
cadence/v0.1.60from
cadence/v0.1.60-1579

Conversation

@ewhauser

@ewhauser ewhauser commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Port of pgdogdev#1579 onto v0.1.60.

pg_try_advisory_lock[_shared] used to pin the client to its server
connection even when the call returned false, so a contended try-lock
leaked a pinned backend until disconnect. Top-level try-lock columns are
now recorded during parsing, and the query engine reads each DataRow's
boolean (honouring Bind result formats) and only tracks the session lock
when it was acquired. Unreadable results or an ErrorResponse are treated
as indeterminate and keep the previous optimistic pin.

Adapted to v0.1.60's advisory-lock changes: AdvisoryLockId
(one/two-parameter) keys, pg_catalog-qualified function names, and
single-shard routing of advisory-lock queries, which keeps the
row-to-lock mapping one-to-one.

…on v0.1.60)

Port of pgdogdev#1579 onto v0.1.60.

pg_try_advisory_lock[_shared] used to pin the client to its server
connection even when the call returned false, so a contended try-lock
leaked a pinned backend until disconnect. Top-level try-lock columns are
now recorded during parsing, and the query engine reads each DataRow's
boolean (honouring Bind result formats) and only tracks the session lock
when it was acquired. Unreadable results or an ErrorResponse are treated
as indeterminate and keep the previous optimistic pin.

Adapted to v0.1.60's advisory-lock changes: AdvisoryLockId
(one/two-parameter) keys, pg_catalog-qualified function names, and
single-shard routing of advisory-lock queries, which keeps the
row-to-lock mapping one-to-one.
@ewhauser
ewhauser merged commit ee82b3e into cadence/v0.1.60 Oct 3, 2026
1 of 6 checks passed
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.

1 participant