Skip to content

fix(config): make configured checkout retries apply to the queries they are meant to retry - #58

Merged
yordis merged 2 commits into
mainfrom
yordis/fix-checkout-retries-per-call
Oct 26, 2026
Merged

yordis merged 2 commits into
mainfrom
yordis/fix-checkout-retries-per-call

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
Changes connection checkout behavior across append, subscribe, and subscription DB paths; mis-threading could alter retry semantics under pool pressure, but scope is limited to :checkout_retries and is covered by new integration tests.

Overview
Ensures configured checkout_retries is honored on every DB checkout, not only at pool startup. DBConnection reads :checkout_retries from per-call options, so the PR adds Config.checkout_opts/1 and threads those opts through subscriptions, notifications, and stream queries/transactions.

Subscribe and subscription lifecycle paths merge checkout_opts into Stream.start_from, store them on subscription state, and route storage calls (create/delete subscription, catch-up reads, checkpoints) through a shared query_opts helper.

Append and other stream operations pick up :checkout_retries via Stream.query_opts/1. The notification Publisher gets the same opts for read_stream_forward.

Tests use an extended TcpProxy (sever / severed) to assert append, start_from: :current, and running subscriptions each attempt checkout retries + 1 times when the pool is exhausted and connections are broken.

Reviewed by Cursor Bugbot for commit b8ae01d. 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 23 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: 9c2b0aa2-1a64-410e-ae9f-27b5a562da2c
Commits

Reviewing files that changed from the base of the PR and between 73f2132 and db8ed35.

Files selected for processing: 9
  • lib/event_store.ex
  • lib/event_store/config.ex
  • lib/event_store/notifications/publisher.ex
  • lib/event_store/notifications/supervisor.ex
  • lib/event_store/streams/stream.ex
  • lib/event_store/subscriptions/subscription_fsm.ex
  • lib/event_store/subscriptions/subscription_state.ex
  • test/checkout_retries_test.exs
  • test/support/tcp_proxy.ex
  • 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 checkout retries per call fix(config): make configured checkout retries apply to the queries they are meant to retry Oct 26, 2026
@yordis
yordis force-pushed the yordis/fix-checkout-retries-per-call branch from b8ae01d to 396d50f 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-checkout-retries-per-call branch from 396d50f to ee22e35 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-checkout-retries-per-call branch from ee22e35 to c38c3c6 Compare October 26, 2026 17:46
Base automatically changed from yordis/test-clock-skew-tolerance to main October 26, 2026 17:46
…ueries they are meant to retry

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…ey are meant to retry

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis force-pushed the yordis/fix-checkout-retries-per-call branch from c38c3c6 to db8ed35 Compare October 26, 2026 17:47
@yordis
yordis merged commit eac69f8 into main Oct 26, 2026
6 of 7 checks passed
@yordis
yordis deleted the yordis/fix-checkout-retries-per-call branch October 26, 2026 19:31
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