20470: Remove locks on containers table
[arvados.git] / services / api / app / controllers / arvados / v1 / containers_controller.rb
index b06d65a36c13bfda924fb40f6408bcfe8363d748..b7dc0302299227791451d0ea6e60198e93cf08b2 100644 (file)
@@ -28,14 +28,6 @@ class Arvados::V1::ContainersController < ApplicationController
     show
   end
 
-  def update
-    # 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
-
   def find_objects_for_index
     super
     if action_name == 'lock' || action_name == 'unlock'
@@ -61,13 +53,8 @@ class Arvados::V1::ContainersController < ApplicationController
   end
 
   def update_priority
-    # 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
+    @object.update_priority!
+    show
   end
 
   def current