提交 290620b2 authored 作者: Frederic's avatar Frederic

get the lock if we err too frequently.

上级 9faa62d7
...@@ -1121,7 +1121,9 @@ class ModuleCache(object): ...@@ -1121,7 +1121,9 @@ class ModuleCache(object):
# same time. This can happen as we read the cache # same time. This can happen as we read the cache
# without taking the lock. # without taking the lock.
if i == 2: if i == 2:
raise with compilelock.lock_ctx():
with open(key_pkl, 'rb') as f:
key_data = cPickle.load(f)
time.sleep(2) time.sleep(2)
found = sum(key == other_key for other_key in key_data.keys) found = sum(key == other_key for other_key in key_data.keys)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论