Skip to content

Commit

Permalink
Try to work around lack of concurrency-safety in fsspec
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Nov 14, 2022
1 parent 24727b8 commit 2423cc5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions datalad_fuse/fuse_.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ def getattr(self, path, fh=None):
fsspec_file, timestamp=self._adapter.get_commit_datetime(path)
)
if to_close:
fsspec_file.close()
try:
fsspec_file.close()
except KeyError:
pass
else:
# TODO: although seems to be logical -- seems to cause logging etc
# lgr.error("ENOENTing %s %s", path, fh)
Expand Down Expand Up @@ -259,7 +262,10 @@ def release(self, path, fh):
# files, so we need to provide some proper use of lru_cache
# to have not recently used closed
if f is not None and not f.closed:
f.close()
try:
f.close()
except KeyError:
pass
return 0

def readlink(self, path):
Expand Down

0 comments on commit 2423cc5

Please sign in to comment.