[arvados] updated: 2.6.0-81-gb68d2d12f
git repository hosting
git at public.arvados.org
Sat Apr 29 04:24:24 UTC 2023
Summary of changes:
.../arvados/v1/container_requests_controller.rb | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
via b68d2d12f4dff73d371297688d84f32289c06907 (commit)
from f4667c5346cff5c91c6e75476d624c974c4857f0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit b68d2d12f4dff73d371297688d84f32289c06907
Author: Tom Clegg <tom at curii.com>
Date: Sat Apr 29 00:23:36 2023 -0400
20447: Don't lock containers table for CR name/description updates.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/services/api/app/controllers/arvados/v1/container_requests_controller.rb b/services/api/app/controllers/arvados/v1/container_requests_controller.rb
index 75f70b1a2..586567cb2 100644
--- a/services/api/app/controllers/arvados/v1/container_requests_controller.rb
+++ b/services/api/app/controllers/arvados/v1/container_requests_controller.rb
@@ -38,10 +38,18 @@ class Arvados::V1::ContainerRequestsController < ApplicationController
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"
+ if (resource_attrs.keys - [:owner_uuid, :name, :description, :properties]).empty?
+ # If no attributes are being updated besides these, there are no
+ # cascading changes to other rows/tables, so we should just use
+ # row locking.
+ @object.reload(lock: true)
super
+ else
+ # 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
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list