16470: Adds an explicit reload before every pending with_lock call.
[arvados.git] / services / api / app / models / collection.rb
index caac5611e79c8baa43d30e396b33cc4a92f9d146..8f724e1f5f94bee57982a260e6caa660f81f8ac9 100644 (file)
@@ -259,10 +259,10 @@ class Collection < ArvadosModel
     should_preserve_version = should_preserve_version? # Time sensitive, cache value
     return(yield) unless (should_preserve_version || syncable_updates.any?)
 
-    # Put aside the changes because with_lock forces a record reload
+    # Put aside the changes because with_lock requires an explicit record reload
     changes = self.changes
     snapshot = nil
-    with_lock do
+    reload.with_lock do
       # Copy the original state to save it as old version
       if should_preserve_version
         snapshot = self.dup