Handle new execute_intent non-raising behaviour - #1048
Open
andrewn617 wants to merge 2 commits into
Open
Conversation
adrianna-chang-shopify
approved these changes
Sep 3, 2026
andrewn617
force-pushed
the
execute-intent-without-raising
branch
from
September 3, 2026 19:29
f7f369b to
a426727
Compare
…red on the query intent and raise it to trip the circuit breaker, then rescue and allow Rails to continue execution.
andrewn617
force-pushed
the
execute-intent-without-raising
branch
from
September 3, 2026 19:36
a426727 to
60406e6
Compare
Edouard-chin
reviewed
Sep 3, 2026
| # any errors here to trip the circuit breaker. Then we can swallow the error and return the result for | ||
| # Rails to continue with. | ||
| if intent.respond_to?(:error) | ||
| delivered_error.equal?(intent.error) |
Member
There was a problem hiding this comment.
That should be on line 77 where Adrianna commented
Edouard-chin
reviewed
Sep 3, 2026
| # Rails to continue with. | ||
| if intent.respond_to?(:error) | ||
| delivered_error.equal?(intent.error) | ||
| raise delivered_error if delivered_error |
Member
There was a problem hiding this comment.
I don't fully get were delivered_error gets assigned ?
Edouard-chin
reviewed
Sep 3, 2026
Edouard-chin
left a comment
Member
There was a problem hiding this comment.
It would be good to also rm -rf the Gemfile.lock before the bundle install steps kicks in on CI. This way we are sure bundler picks the latest Rails edge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rails/rails#58049 refactored
execute_intentto no longer raise errors. Instead execution errors are stored on the query intent and can be checked later by the caller. This is to pave the way for better async execution.However, semian relies on the raising behaviour to trip the circuit breaker. With this change to Rails, any query that fails mid execution will be considered successful by Semian. And indeed
ActiveRecordTrilogyAdapterTest#test_read_timeout_error_opens_the_circuitfails when we bump Rails to this commit.To solve it, in our
execute_intentpatch we can check the intent for an error and raise it within theacquire_semian_resourceblock to trip the circuit breaker. Then we can rescue it and return the result to match the new Rails behaviour.