Open tostart-pickagreatname opened 2 months ago
Update, the change actually came in 7.2
not 7.2.1
.
A workaround for whoever ran into this issue with Rails 7.2 and Que 2.4—put this in your app/jobs/application_job.rb
.
class ApplicationJob < ActiveJob::Base
# Automatically retry jobs that encountered a deadlock
# retry_on ActiveRecord::Deadlocked
# Most jobs are safe to ignore if the underlying records are no longer available
# discard_on ActiveJob::DeserializationError
# Wait for the transaction to commit before enqueuing
self.enqueue_after_transaction_commit = :always
end
Rails 7.2.1 requires that queues implement the
enqueue_after_transaction_commit?
method.The impact of not having this method and upgrading to
7.2.1
is that all job enqueuing fails.This method is described in https://github.com/rails/rails/commit/e922c59207c406d51541622690737783e0ec338e
This commit also introduced
ActiveJob::QueueAdapters::AbstractAdapter
which all rails queues now inherit from.In the future, the best path would be to have the adapter inherit from
AbstractAdapter
, to avoid new methods breaking job enqueuing.At this time, however, its default behaviour could simply be implemented.