[ARVADOS] updated: 26e095318c7c368089ea368e6e4854b62a6c7830

Git user git at public.curoverse.com
Thu Jul 27 10:06:44 EDT 2017


Summary of changes:
 services/fuse/arvados_fuse/__init__.py |  5 ++++-
 services/fuse/arvados_fuse/fusedir.py  | 18 ++++++++++--------
 2 files changed, 14 insertions(+), 9 deletions(-)

       via  26e095318c7c368089ea368e6e4854b62a6c7830 (commit)
      from  408cbfd4f3737ef5bfbf908d96ac9c469fcf6cdd (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 26e095318c7c368089ea368e6e4854b62a6c7830
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Jul 27 10:06:09 2017 -0400

    11158: Handle trash/untrash events for collections in projects.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curoverse.com>

diff --git a/services/fuse/arvados_fuse/__init__.py b/services/fuse/arvados_fuse/__init__.py
index 175ec3b..30770fc 100644
--- a/services/fuse/arvados_fuse/__init__.py
+++ b/services/fuse/arvados_fuse/__init__.py
@@ -409,7 +409,10 @@ class Operations(llfuse.Operations):
                     # subsecond precision (see #6347) so use event_at
                     # which should always be the same.
                     stamp = ev.get("event_at")
-                    if stamp and pdh and item.writable() and item.collection is not None and item.collection.modified():
+                    if (stamp and pdh and item.writable() and
+                        item.collection is not None and
+                        item.collection.modified() and
+                        new_attrs.get("is_trashed") is not True):
                         item.update(to_record_version=(stamp, pdh))
 
             oldowner = old_attrs.get("owner_uuid")
diff --git a/services/fuse/arvados_fuse/fusedir.py b/services/fuse/arvados_fuse/fusedir.py
index 9869b9f..0178fe5 100644
--- a/services/fuse/arvados_fuse/fusedir.py
+++ b/services/fuse/arvados_fuse/fusedir.py
@@ -987,25 +987,27 @@ class ProjectDirectory(Directory):
             # Was moved to somewhere else, so don't try to add entry
             new_name = None
 
-        if ev.get("object_kind") == "arvados#collection" and old_attrs == new_attrs:
-            with llfuse.lock_released:
-                cr = self.api.collections().list(filters=[["uuid", "=", ev["object_uuid"]]], include_trash=True).execute(num_retries=self.num_retries)
-                if cr['items'] and cr['items'][0]['is_trashed']:
-                    new_name = None
+        if ev.get("object_kind") == "arvados#collection":
+            if old_attrs.get("is_trashed"):
+                # Was previously deleted
+                old_name = None
+            if new_attrs.get("is_trashed"):
+                # Has been deleted
+                new_name = None
 
         if new_name != old_name:
             ent = None
             if old_name in self._entries:
                 ent = self._entries[old_name]
                 del self._entries[old_name]
-            self.inodes.invalidate_entry(self.inode, old_name.encode(self.inodes.encoding))
+                self.inodes.invalidate_entry(self.inode, old_name.encode(self.inodes.encoding))
 
             if new_name:
-                if ent:
+                if ent is not None:
                     self._entries[new_name] = ent
                 else:
                     self._add_entry(new_attrs, new_name)
-            elif ent:
+            elif ent is not None:
                 self.inodes.del_entry(ent)
 
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list