end
def update
- @object.with_lock do
+ # Lock containers table to avoid deadlock in cascading priority update (see #20240)
+ Container.transaction do
+ ActiveRecord::Base.connection.execute "LOCK TABLE containers IN EXCLUSIVE MODE"
super
end
end
end
def update_priority
- @object.reload(lock: true)
- @object.update_priority!
- show
+ # Lock containers table to avoid deadlock in cascading priority update (see #20240)
+ Container.transaction do
+ ActiveRecord::Base.connection.execute "LOCK TABLE containers IN EXCLUSIVE MODE"
+ @object.reload(lock: true)
+ @object.update_priority!
+ show
+ end
end
def current