Skip to content

fix(subscriptions): stop a stale verification retry from polling alongside the pending one - #67

Merged
yordis merged 2 commits into
yordis/test-verify-sessions-timerfrom
yordis/fix-stale-verify-timer
Oct 26, 2026
Merged

yordis merged 2 commits into
yordis/test-verify-sessions-timerfrom
yordis/fix-stale-verify-timer

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

Medium Risk
Touches advisory-lock reconciliation after DB disconnects; incorrect timer handling could affect subscription lock cleanup, but behavior is narrowed with cancellation and ref matching plus new regression coverage.

Overview
Fixes stale session-verification retries in EventStore.AdvisoryLocks so obsolete timers cannot run a second unlock-reconciliation loop alongside the current one.

Verification backoff now uses :erlang.start_timer with the reference stored in verify_timer, and handlers only act on {:timeout, ref, :verify_sessions} when ref matches that field; other timeout messages are ignored. When the lock pool monitor goes down, cancel_verify_retry cancels the active timer instead of only clearing state.

A new disconnect test asserts that delivering an outdated retry message leaves the newer pending timer unchanged.

Reviewed by Cursor Bugbot for commit e3f520e. 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: da480d77-2bbf-4bbb-aca0-93ebecc67f75
Commits

Reviewing files that changed from the base of the PR and between 656fca0 and 15063c6.

Files selected for processing: 2
  • lib/event_store/advisory_locks.ex
  • 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 changed the title yordis/fix stale verify timer fix(subscriptions): stop a stale verification retry from polling alongside the pending one Oct 26, 2026
@yordis
yordis force-pushed the yordis/fix-stale-verify-timer branch from e3f520e to a2008fa 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/fix-stale-verify-timer branch from a2008fa to 05cc6e8 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/fix-stale-verify-timer branch 2 times, most recently from ac0445c to d2b106d Compare October 26, 2026 17:47
…ion retry starting a second polling loop

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…gside the pending one

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
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