Commit b109c272 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

fix deadlock with get_dir_contents

parent f10c0b1b
......@@ -695,6 +695,7 @@ class LocalfsFileClient(FileClient):
return LocalfsTargetHandle(self, target_state)
def get_dir_contents(self, objname):
logger.debug("Getting contents for object '%s'" % objname)
with TransactedConnection(self.syncer_dbtuple) as db:
return db.get_dir_contents(self.SIGNATURE, objname)
......@@ -708,10 +709,10 @@ class LocalfsFileClient(FileClient):
rel_path = os.path.relpath(path, start=self.ROOTPATH)
objname = utils.to_standard_sep(rel_path)
leaves = self.get_dir_contents(objname) if rec else None
with self.probe_candidates.lock() as d:
d[objname] = self.none_info()
if rec:
leaves = self.get_dir_contents(objname)
for leaf in leaves:
d[leaf] = self.none_info()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment