[arvados] updated: 2.7.0-6105-g5882d86c3b

git repository hosting git at public.arvados.org
Wed Mar 6 23:32:20 UTC 2024


Summary of changes:
 sdk/python/arvados/safeapi.py          | 4 ++--
 services/fuse/arvados_fuse/__init__.py | 6 +++---
 services/fuse/arvados_fuse/command.py  | 2 +-
 services/fuse/arvados_fuse/fusedir.py  | 2 ++
 4 files changed, 8 insertions(+), 6 deletions(-)

       via  5882d86c3b0b98c4bc8ac23f6faea350016e5077 (commit)
      from  ed32d41e28c05a83496cf05f7ec956ca5fe10d4f (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 5882d86c3b0b98c4bc8ac23f6faea350016e5077
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Wed Mar 6 18:30:25 2024 -0500

    21541: try to reduce cache churn
    
    use move_to_end instead of remove/re-add
    
    call cap_cache once instead of every time an entry is added.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/sdk/python/arvados/safeapi.py b/sdk/python/arvados/safeapi.py
index 56b92e8f08..7acabd7b58 100644
--- a/sdk/python/arvados/safeapi.py
+++ b/sdk/python/arvados/safeapi.py
@@ -68,9 +68,9 @@ class ThreadSafeApiCache(object):
         self.keep = keep.KeepClient(api_client=self, **keep_params)
 
     def localapi(self) -> 'googleapiclient.discovery.Resource':
-        try:
+        if 'api' in self.local.__dict__:
             client = self.local.api
-        except AttributeError:
+        else:
             client = api.api_client(**self._api_kwargs)
             client._http._request_id = lambda: self.request_id or util.new_request_id()
             self.local.api = client
diff --git a/services/fuse/arvados_fuse/__init__.py b/services/fuse/arvados_fuse/__init__.py
index b075c9085e..c04a880122 100644
--- a/services/fuse/arvados_fuse/__init__.py
+++ b/services/fuse/arvados_fuse/__init__.py
@@ -232,13 +232,13 @@ class InodeCache(object):
             self._total += obj.objsize()
             _logger.debug("InodeCache touched inode %i (size %i) (uuid %s) total now %i (%i entries)",
                           obj.inode, obj.objsize(), obj.cache_uuid, self._total, len(self._entries))
-            self.cap_cache()
 
     def touch(self, obj):
         if obj.persisted():
             if obj.inode in self._entries:
-                self._remove(obj, False)
-            self.manage(obj)
+                self._entries.move_to_end(obj.inode)
+            else:
+                self.manage(obj)
 
     def unmanage(self, obj):
         if obj.persisted() and obj.inode in self._entries:
diff --git a/services/fuse/arvados_fuse/command.py b/services/fuse/arvados_fuse/command.py
index 610da477ca..c24e4f7764 100644
--- a/services/fuse/arvados_fuse/command.py
+++ b/services/fuse/arvados_fuse/command.py
@@ -381,7 +381,7 @@ class Mount(object):
         e = self.operations.inodes.add_entry(Directory(
             llfuse.ROOT_INODE,
             self.operations.inodes,
-            self.api.config,
+            lambda: self.api.config(),
             self.args.enable_write,
             self.args.filters,
         ))
diff --git a/services/fuse/arvados_fuse/fusedir.py b/services/fuse/arvados_fuse/fusedir.py
index eeb96bceb3..b202493e4a 100644
--- a/services/fuse/arvados_fuse/fusedir.py
+++ b/services/fuse/arvados_fuse/fusedir.py
@@ -216,6 +216,8 @@ class Directory(FreshBase):
 
         self.fresh()
 
+        self.inodes.inode_cache.cap_cache()
+
     def in_use(self):
         if super(Directory, self).in_use():
             return True

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list