Skip to content

chore(test): keep the zombie lock test from terminating a session that holds some other advisory lock - #55

Merged
yordis merged 1 commit into
mainfrom
yordis/test-scope-zombie-lock-count
Oct 26, 2026
Merged

yordis merged 1 commit into
mainfrom
yordis/test-scope-zombie-lock-count

Conversation

@yordis

@yordis yordis commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

@cursor

cursor Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only changes to advisory-lock selection and fixtures; no production subscription or locking behavior is modified.

Overview
Hardens the subscription zombie lock integration test so teardown targets only the real subscription owner, not any session holding an unrelated PostgreSQL advisory lock.

terminate_lock_holder now resolves the backend PID via pg_locks joined to the schema’s subscriptions row (database, classid, and subscription_name), instead of terminating the first granted advisory lock on the server.

The test also calls new hold_unrelated_advisory_locks to acquire decoy locks from another database and from a second connection in the same DB (different lock key shape), documenting that advisory locks are server-wide and must not be confused with the subscription lock.

Reviewed by Cursor Bugbot for commit 4ca974f. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 24 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e912dbb8-8401-455e-9368-304ce1069d68
Commits

Reviewing files that changed from the base of the PR and between 7a62b0b and a16bcb4.

Files selected for processing: 1
  • test/subscriptions/subscription_zombie_lock_test.exs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@yordis
yordis added this pull request to stack #73 October 26, 2026 16:00
@yordis
yordis force-pushed the yordis/test-scope-zombie-lock-count branch from 4ca974f to c6730c1 Compare October 26, 2026 16:16
@yordis
yordis removed this pull request from stack #73 October 26, 2026 16:53
@yordis
yordis force-pushed the yordis/test-scope-zombie-lock-count branch from c6730c1 to bcb5e8e Compare October 26, 2026 16:54
@yordis
yordis added this pull request to stack #74 October 26, 2026 17:10
Base automatically changed from yordis/docs-lock-loss-signal to main October 26, 2026 17:45
…sion that holds some other advisory lock

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis force-pushed the yordis/test-scope-zombie-lock-count branch from bcb5e8e to a16bcb4 Compare October 26, 2026 17:46
@yordis
yordis merged commit f6297fd into main Oct 26, 2026
3 checks passed
@yordis
yordis deleted the yordis/test-scope-zombie-lock-count branch October 26, 2026 17:46
@yordis yordis changed the title test(subscriptions): keep the zombie lock test from terminating a session that holds some other advisory lock chore(test): keep the zombie lock test from terminating a session that holds some other advisory lock Oct 26, 2026
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