提交 22967901 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

More comments

上级 1c8a8433
...@@ -390,6 +390,9 @@ class ModuleCache(object): ...@@ -390,6 +390,9 @@ class ModuleCache(object):
rval = self.module_from_name[name] rval = self.module_from_name[name]
else: else:
# we have never seen this key before # we have never seen this key before
# Acquire lock before creating things in the compile cache,
# to avoid that other processes remove the compile dire while it
# is still empty
compilelock.get_lock() compilelock.get_lock()
location = dlimport_workdir(self.dirname) location = dlimport_workdir(self.dirname)
#debug("LOCATION*", location) #debug("LOCATION*", location)
...@@ -512,8 +515,11 @@ class ModuleCache(object): ...@@ -512,8 +515,11 @@ class ModuleCache(object):
except IOError: except IOError:
has_key = False has_key = False
if not has_key: if not has_key:
#TODO: only if older than 1 week? #TODO: Remove this, or at least wait one week
# it might still be used by another process # This cache dir is either in use by another process
# (in that case, it will be removed by the code above),
# or a remnant of a crashed process, in that case, it will
# be removed by clear_old at some point.
info("clear_unversioned removing cache dir", filename) info("clear_unversioned removing cache dir", filename)
_rmtree(os.path.join(self.dirname, filename)) _rmtree(os.path.join(self.dirname, filename))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论