Skip to content

fix: correctly handle pg_try_advisory_lock - #1775

Merged
levkk merged 1 commit into
mainfrom
levkk-advisory-locks-try
Oct 10, 2026
Merged

levkk merged 1 commit into
mainfrom
levkk-advisory-locks-try

Conversation

@levkk

@levkk levkk commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

We assumed all calls to pg_try_advisory_lock were successful and pinned the client.

Solution

Parse the result we receive from Postgres and only record the advisory lock as acquired if the function call returns true.

fixes #1578

Clean up

  • Cleanup the mess in process_server_message a bit
  • Move advisory lock parsing and its tests into its own module in the parser

@codecov

codecov Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

@levkk
levkk added this pull request to the merge queue Oct 10, 2026
Merged via the queue into main with commit b73c152 Oct 10, 2026
46 checks passed
@levkk
levkk deleted the levkk-advisory-locks-try branch October 10, 2026 16:14
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.

Failed pg_try_advisory_lock pins the client in transaction pooling

1 participant