Accept job arg in SolidQueueAdapter#stopping? for Rails 8.2 compatibility#9
Open
Micaherb wants to merge 1 commit into
Open
Accept job arg in SolidQueueAdapter#stopping? for Rails 8.2 compatibility#9Micaherb wants to merge 1 commit into
Micaherb wants to merge 1 commit into
Conversation
…lity Rails 8.2 (rails/rails@6d1c401d, landed on main 2026-05-26) changed `ActiveJob::Continuable#checkpoint!` to call `queue_adapter.stopping?(self)`, passing the job instance. The upstream CHANGELOG requires every adapter that implements `stopping?` to accept an optional positional argument: > Queue adapters that implement `stopping?` must accept the job as an > optional positional argument, i.e. `def stopping?(job = nil)`, in order to > work with this version and older versions of Rails. SolidQueueAdapter relied on the `stopping?` predicate generated by `class_attribute :stopping`, which takes no arguments. Against Rails main every `checkpoint!` call raised ArgumentError, so continuable jobs never finished and `ContinuationTest#test_continuable_job_completes` failed deterministically across the entire rails_main matrix. Define `stopping?(job = nil)` explicitly. The optional arg keeps the method compatible with Rails 7.1 / 7.2 / 8.0 / 8.1 (which call with no args) and Rails 8.2+ (which passes the job). The job is currently unused -- this adapter doesn't yet support per-job interrupt reasons; that's a separate follow-up.
jpcamara
reviewed
Jun 2, 2026
Comment on lines
+17
to
+19
| def stopping?(job = nil) | ||
| self.class.stopping | ||
| end |
Member
There was a problem hiding this comment.
Good catch - I'd rather see this stay as a PR though and point at that as you upgrade to 8.2, since it's gotta end up in solid queue proper very soon i'd imagine. someone has a PR opened a few days ago rails#747
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.
Summary
CI is failing on main and in PRs. This PR fixes the deterministic
rails_mainCI failure, where every job in the matrix fails with:Root cause
Rails commit
6d1c401d(landed onrails/rails@main2026-05-26, target version8.2.0.alpha) — "Pass job instance to stopping?" — changedActiveJob::Continuable#checkpoint!to call:instead of
queue_adapter.stopping?. The upstream CHANGELOG explicitly requires every adapter to migrate:SolidQueueAdapterwas relying on the no-argstopping?predicate generated byclass_attribute :stopping. Against Rails main everycheckpoint!call raisedArgumentError, the continuable job errored out before completing, and the test asserted unfinished jobs were still present after the 5 s wait.Fix
Define
stopping?(job = nil)explicitly on the adapter. The optional positional arg keeps the method compatible with:nilis usedThe job parameter is intentionally not consumed yet — this adapter doesn't support per-job interrupt reasons. That's a separate enhancement (Rails 8.2 also allows returning a custom reason; we just return
false/trueas before).Test plan
rails_mainjobs (which were failing 9/9 before this fix)rails_7_1/7_2/8_0/8_1(the new signature is backwards compatible)Linked
Unblocks #7.