[ARVADOS] updated: 232cace27f60dbac0f46a9113a4b19a561689f4c

Git user git at public.curoverse.com
Wed Sep 21 14:55:58 EDT 2016


Summary of changes:
 services/fuse/arvados_fuse/__init__.py |  4 ++--
 services/fuse/arvados_fuse/fresh.py    |  6 +++++-
 services/fuse/arvados_fuse/fusedir.py  | 22 ++++++++++------------
 services/fuse/tests/test_cache.py      |  3 ---
 4 files changed, 17 insertions(+), 18 deletions(-)

       via  232cace27f60dbac0f46a9113a4b19a561689f4c (commit)
      from  bb7f064243fcd052e17815129fb1dba2f86d493d (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 232cace27f60dbac0f46a9113a4b19a561689f4c
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Wed Sep 21 14:55:53 2016 -0400

    10117: Restore original semantics of invalidate() and add code comment, add
    kernel_invalidate().

diff --git a/services/fuse/arvados_fuse/__init__.py b/services/fuse/arvados_fuse/__init__.py
index e679a23..ba70959 100644
--- a/services/fuse/arvados_fuse/__init__.py
+++ b/services/fuse/arvados_fuse/__init__.py
@@ -148,8 +148,8 @@ class InodeCache(object):
                 _logger.debug("InodeCache cannot clear inode %i, in use", obj.inode)
                 return False
             if obj.has_ref(only_children=True):
-                obj.invalidate()
-                _logger.debug("InodeCache invalidate inode %i", obj.inode)
+                obj.kernel_invalidate()
+                _logger.debug("InodeCache sent kernel invalidate inode %i", obj.inode)
                 return False
             obj.clear()
         self._total -= obj.cache_size
diff --git a/services/fuse/arvados_fuse/fresh.py b/services/fuse/arvados_fuse/fresh.py
index 95dde2b..532f110 100644
--- a/services/fuse/arvados_fuse/fresh.py
+++ b/services/fuse/arvados_fuse/fresh.py
@@ -70,10 +70,14 @@ class FreshBase(object):
         self.allow_attr_cache = True
         self.allow_dirent_cache = True
 
-    # Mark the value as stale
     def invalidate(self):
+        """Indicate that object contents should be refreshed from source."""
         self._stale = True
 
+    def kernel_invalidate(self):
+        """Indicate that an invalidation for this object should be sent to the kernel."""
+        pass
+
     # Test if the entries dict is stale.
     def stale(self):
         if self._stale:
diff --git a/services/fuse/arvados_fuse/fusedir.py b/services/fuse/arvados_fuse/fusedir.py
index 38fe32c..15f7564 100644
--- a/services/fuse/arvados_fuse/fusedir.py
+++ b/services/fuse/arvados_fuse/fusedir.py
@@ -183,15 +183,11 @@ class Directory(FreshBase):
         self.inodes.invalidate_inode(self.inode)
         self.invalidate()
 
-    def invalidate(self):
-        try:
-            super(Directory, self).invalidate()
-            for n, e in self._entries.iteritems():
-                self.inodes.invalidate_entry(self.inode, n.encode(self.inodes.encoding))
-                e.invalidate()
-            self.inodes.invalidate_inode(self.inode)
-        except Exception:
-            _logger.exception()
+    def kernel_invalidate(self):
+        for n, e in self._entries.iteritems():
+            self.inodes.invalidate_entry(self.inode, n.encode(self.inodes.encoding))
+            e.kernel_invalidate()
+        self.inodes.invalidate_inode(self.inode)
 
     def mtime(self):
         return self._mtime
@@ -339,10 +335,8 @@ class CollectionDirectoryBase(Directory):
         src.flush()
 
     def clear(self):
-        r = super(CollectionDirectoryBase, self).clear()
+        super(CollectionDirectoryBase, self).clear()
         self.collection = None
-        self._manifest_size = 0
-        return r
 
 
 class CollectionDirectory(CollectionDirectoryBase):
@@ -512,6 +506,10 @@ class CollectionDirectory(CollectionDirectoryBase):
                 self.collection.save()
             self.collection.stop_threads()
 
+    def clear(self):
+        super(CollectionDirectory, self).clear()
+        self._manifest_size = 0
+
 
 class TmpCollectionDirectory(CollectionDirectoryBase):
     """A directory backed by an Arvados collection that never gets saved.
diff --git a/services/fuse/tests/test_cache.py b/services/fuse/tests/test_cache.py
index 66b70c9..f90c5b0 100644
--- a/services/fuse/tests/test_cache.py
+++ b/services/fuse/tests/test_cache.py
@@ -11,9 +11,6 @@ import unittest
 from .integration_test import IntegrationTest
 from .mount_test_base import MountTestBase
 
-_logger = logging.getLogger('arvados.arvados_fuse')
-_logger.setLevel(logging.DEBUG)
-
 class TmpCollectionTest(IntegrationTest):
     mnt_args = ["--by-id", "--directory-cache=0"]
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list