_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
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:
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
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):
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.
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"]