[ARVADOS] updated: 2.1.0-1879-g5537e5bf0
Git user
git at public.arvados.org
Sun Feb 6 21:01:09 UTC 2022
Summary of changes:
sdk/python/arvados/collection.py | 2 +-
services/fuse/arvados_fuse/fusedir.py | 14 ++++++++++----
2 files changed, 11 insertions(+), 5 deletions(-)
via 5537e5bf057097f4f059ceabee3cdd381eb3985e (commit)
from d702b6f48fd4463084b7e0654520e6b319a19d21 (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 5537e5bf057097f4f059ceabee3cdd381eb3985e
Author: Peter Amstutz <peter.amstutz at curii.com>
Date: Sun Feb 6 16:00:33 2022 -0500
18719: handle updates on flush()
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>
diff --git a/sdk/python/arvados/collection.py b/sdk/python/arvados/collection.py
index 55be40fa0..a076de6ba 100644
--- a/sdk/python/arvados/collection.py
+++ b/sdk/python/arvados/collection.py
@@ -1395,7 +1395,7 @@ class Collection(RichCollectionBase):
# our tokens.
return
else:
- self._past_versions.add((response.get("modified_at"), response.get("portable_data_hash")))
+ self._remember_api_response(response)
other = CollectionReader(response["manifest_text"])
baseline = CollectionReader(self._manifest_text)
self.apply(baseline.diff(other))
diff --git a/services/fuse/arvados_fuse/fusedir.py b/services/fuse/arvados_fuse/fusedir.py
index 704dbe439..1f018af81 100644
--- a/services/fuse/arvados_fuse/fusedir.py
+++ b/services/fuse/arvados_fuse/fusedir.py
@@ -463,8 +463,12 @@ class CollectionDirectory(CollectionDirectoryBase):
if not self.writable():
return
with llfuse.lock_released:
- self.collection.save()
- self.new_collection_record(self.collection.api_response())
+ with self._updating_lock:
+ if self.collection.committed():
+ self.collection.update()
+ else:
+ self.collection.save()
+ self.new_collection_record(self.collection.api_response())
def want_event_subscribe(self):
return (uuid_pattern.match(self.collection_locator) is not None)
@@ -510,7 +514,7 @@ class CollectionDirectory(CollectionDirectoryBase):
if not self.stale():
return True
- _logger.debug("Updating collection %s inode %s to record version %s", self.collection_locator, self.inode)
+ _logger.debug("Updating collection %s inode %s", self.collection_locator, self.inode)
coll_reader = None
if self.collection is not None:
# Already have a collection object
@@ -563,8 +567,8 @@ class CollectionDirectory(CollectionDirectoryBase):
return False
@use_counter
- @check_update
def collection_record(self):
+ self.flush()
return self.collection.api_response()
@use_counter
@@ -575,6 +579,7 @@ class CollectionDirectory(CollectionDirectoryBase):
self.collection_record_file = FuncToJSONFile(
self.inode, self.collection_record)
self.inodes.add_entry(self.collection_record_file)
+ self.collection_record_file.invalidate()
return self.collection_record_file
else:
return super(CollectionDirectory, self).__getitem__(item)
@@ -662,6 +667,7 @@ class TmpCollectionDirectory(CollectionDirectoryBase):
self.collection_record_file = FuncToJSONFile(
self.inode, self.collection_record)
self.inodes.add_entry(self.collection_record_file)
+ self.collection_record_file.invalidate()
return self.collection_record_file
return super(TmpCollectionDirectory, self).__getitem__(item)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list