Skip to content

chore(test): catch a server restart that reuses the backend pid of the lock session - #64

Merged
yordis merged 1 commit into
yordis/test-stale-notice-reffrom
yordis/test-postgres-restart
Oct 26, 2026
Merged

yordis merged 1 commit into
yordis/test-stale-notice-reffrom
yordis/test-postgres-restart

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 change with no production code modifications.

Overview
Adds a disconnect integration test for AdvisoryLocks that models a PostgreSQL restart or failover where the lock pool reconnects with the same backend pid but a new session (cleared eventstore.session_id).

After acquiring a lock, the test simulates that scenario and sends {:connected, lock_connection}; it expects owners to receive {AdvisoryLocks, :lock_released, lock, :session_ended} so subscription fencing does not treat the old lock as still valid when only the session identity changed.

Reviewed by Cursor Bugbot for commit 19b1b2d. 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 59 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: 4f3c2ff5-6f63-4d9e-886e-530637b92452
Commits

Reviewing files that changed from the base of the PR and between b9ea809 and b39e512.

Files selected for processing: 1
  • test/advisory_locks_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-postgres-restart branch from 19b1b2d to dc7cd29 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-postgres-restart branch from dc7cd29 to 6f814c2 Compare October 26, 2026 16:54
@yordis
yordis added this pull request to stack #74 October 26, 2026 17:10
@yordis
yordis force-pushed the yordis/test-postgres-restart branch 2 times, most recently from 3dd1ae6 to bb7f7fa Compare October 26, 2026 17:47
…id of the lock session

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis force-pushed the yordis/test-postgres-restart branch from bb7f7fa to b39e512 Compare October 26, 2026 19:31
@yordis yordis changed the title test(subscriptions): catch a server restart that reuses the backend pid of the lock session chore(test): catch a server restart that reuses the backend pid of the lock session Oct 26, 2026
@yordis
yordis merged commit a7968c0 into main Oct 26, 2026
7 of 8 checks passed
@yordis
yordis deleted the yordis/test-postgres-restart branch October 26, 2026 22:05
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