Skip to content

Use concrete Trilogy retry exception classes#183

Open
neilshopify wants to merge 6 commits into
Shopify:masterfrom
neilshopify:fix-trilogy-retry-errors
Open

Use concrete Trilogy retry exception classes#183
neilshopify wants to merge 6 commits into
Shopify:masterfrom
neilshopify:fix-trilogy-retry-errors

Conversation

@neilshopify

@neilshopify neilshopify commented Jun 12, 2026

Copy link
Copy Markdown

Summary

  • Replace the Trilogy::ConnectionError retry key with concrete Trilogy connection exception classes.
  • Filter Trilogy retry keys to actual Exception classes so newer retriable versions accept the config.
  • Use max_elapsed_time: Float::MAX instead of Float::INFINITY for an effectively unbounded elapsed time in a format accepted by both older and newer retriable.
  • Retry trigger existence checks during LHM invocations.
  • Update parallel integration tests to use separate writer connections.
  • Bump lhm-shopify to 4.5.2.

Why

Newer retriable versions validate the on: configuration before running the retried block. Each retry key must be an exception class, or a collection of exception classes.

Trilogy::ConnectionError is a module, not an exception class, and max_elapsed_time: Float::INFINITY is no longer accepted by newer retriable as a finite non-negative number. LHM can fail during retry configuration validation with errors like:

on must be an Exception class or a collection of Exception classes, got Trilogy::ConnectionError
max_elapsed_time must be a non-negative number

This changes the Trilogy retry config to use concrete exception classes such as Trilogy::BaseConnectionError, Trilogy::SSLError, Trilogy::ConnectionClosed, and the concrete syscall error classes, preserving the intended retry behavior while remaining compatible with stricter retriable validation.

Release

This PR bumps the gem version to 4.5.2 and updates the changelog/lockfiles. After merge, a maintainer can publish with:

bundle exec rake release

Test

  • bundle install
  • bundle exec appraisal install
  • bundle exec ruby -I spec spec/unit/sql_retry_spec.rb
  • bundle exec rake build

@neilshopify

Copy link
Copy Markdown
Author

@coding-chimp would you mind taking a look when you have a chance? This fixes the retriable incompatibility with the Trilogy retry config and includes the 4.5.2 version bump for release.

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