[ARVADOS] updated: 6349237efb19ca7fcad94333090d694fda3d4374

Git user git at public.curoverse.com
Fri Oct 21 15:17:12 EDT 2016


Summary of changes:
 services/fuse/arvados_fuse/__init__.py   |  6 ++++++
 services/fuse/tests/test_token_expiry.py | 13 ++++++++-----
 2 files changed, 14 insertions(+), 5 deletions(-)

       via  6349237efb19ca7fcad94333090d694fda3d4374 (commit)
      from  ed16f0c1f600acd7bab81796ec22fde90ecdfa7f (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 6349237efb19ca7fcad94333090d694fda3d4374
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Oct 21 15:16:24 2016 -0400

    10008: Call checkupdate() on ancestors when opening a file.

diff --git a/services/fuse/arvados_fuse/__init__.py b/services/fuse/arvados_fuse/__init__.py
index 6ac51f4..6a5a0fe 100644
--- a/services/fuse/arvados_fuse/__init__.py
+++ b/services/fuse/arvados_fuse/__init__.py
@@ -501,6 +501,12 @@ class Operations(llfuse.Operations):
         fh = next(self._filehandles_counter)
         self._filehandles[fh] = FileHandle(fh, p)
         self.inodes.touch(p)
+        while p.parent_inode in self.inodes:
+            if p == self.inodes[p.parent_inode]:
+                break
+            p = self.inodes[p.parent_inode]
+            self.inodes.touch(p)
+            p.checkupdate()
 
         _logger.debug("arv-mount open inode %i flags %x fh %i", inode, flags, fh)
 
diff --git a/services/fuse/tests/test_token_expiry.py b/services/fuse/tests/test_token_expiry.py
index 1b1be18..16611dc 100644
--- a/services/fuse/tests/test_token_expiry.py
+++ b/services/fuse/tests/test_token_expiry.py
@@ -44,10 +44,13 @@ class TokenExpiryTest(IntegrationTest):
             with mock.patch.object(self.mount.api.collections(), 'get', wraps=self.mount.api.collections().get) as mocked_get:
                 self.pool_test(os.path.join(self.mnt, 'zzz'))
 
-        self.assertEqual(3, mocked_open.call_count)
-        self.assertEqual(
-            4, mocked_get.call_count,
-            'Not enough calls to collections().get(): expected 4, got {!r}'.format(
+        # open() several times here to make sure we don't reach our
+        # quota of mocked_get.call_count dishonestly (e.g., the first
+        # open causes 5 mocked_get, and the rest cause none).
+        self.assertEqual(8, mocked_open.call_count)
+        self.assertGreaterEqual(
+            mocked_get.call_count, 8,
+            'Not enough calls to collections().get(): expected 8, got {!r}'.format(
                 mocked_get.mock_calls))
 
     @staticmethod
@@ -55,6 +58,6 @@ class TokenExpiryTest(IntegrationTest):
         uuid = 'zzzzz-4zz18-op4e2lbej01tcvu'
         fnm = 'zzzzz-8i9sb-0vsrcqi7whchuil.log.txt'
         os.listdir(os.path.join(zzz, uuid))
-        for _ in range(3):
+        for _ in range(8):
             with open(os.path.join(zzz, uuid, fnm)) as f:
                 f.read()

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list