Skip to content

Avoid retries and reconnects after Semian rejects access - #1054

Open
efegokdemir wants to merge 1 commit into
Shopify:mainfrom
efegokdemir:fix/rails-semian-rejections
Open

efegokdemir wants to merge 1 commit into
Shopify:mainfrom
efegokdemir:fix/rails-semian-rejections

Conversation

@efegokdemir

Copy link
Copy Markdown

Fixes #1051.

Protect verify! and reconnect! before Rails can reset or close an existing connection, and exclude Semian errors from connection retries. For Rails 8.2, deliver acquisition rejections to the query intent so result access raises the original error without a second acquisition. Exception inheritance and active?'s boolean behaviour are preserved.

The shared regressions cover both adapters, open/busy rejections, synchronous retry settings, async completion and connection recovery. They fail on unchanged main (22 failures with Rails 8.1.4; 26 with Rails 8.2) and pass with this change.

Validated on Ruby 3.3/macOS with PostgreSQL 16 and MariaDB 13: 79 released-Rails adapter tests, 83 edge-Rails adapter tests, 196 common tests, rubocop and rake build. Local runs exclude Linux bulkhead checks and one existing PostgreSQL error-class assertion, whose failure was also reproduced on unchanged main. The native Linux extension and full service-backed matrix still need CI.

This branch has not been deployed

No deployments
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.

Prevent Rails from retrying / reconnecting after Semian rejects database access

1 participant