From: Zooko O'Whielacronx Date: Thu, 7 Feb 2013 16:35:43 +0000 (+0000) Subject: do not cache and re-use imm filenodes in nodemaker X-Git-Tag: allmydata-tahoe-1.10a1~21 X-Git-Url: https://git.rkrishnan.org/vdrive/%22news.html/class-simplejson.JSONEncoder-index.html?a=commitdiff_plain;h=45c64edc768eca0f2bca474f03d332a9ada70a8b;p=tahoe-lafs%2Ftahoe-lafs.git do not cache and re-use imm filenodes in nodemaker fixes #1679 --- diff --git a/src/allmydata/immutable/filenode.py b/src/allmydata/immutable/filenode.py index 7def22c8..79e282d9 100644 --- a/src/allmydata/immutable/filenode.py +++ b/src/allmydata/immutable/filenode.py @@ -86,6 +86,8 @@ class CiphertextFileNode: def raise_error(self): pass + def is_mutable(self): + return False def check_and_repair(self, monitor, verify=False, add_lease=False): c = Checker(verifycap=self._verifycap, diff --git a/src/allmydata/nodemaker.py b/src/allmydata/nodemaker.py index c820c71c..d590bf5a 100644 --- a/src/allmydata/nodemaker.py +++ b/src/allmydata/nodemaker.py @@ -72,12 +72,12 @@ class NodeMaker: cap = uri.from_string(bigcap, deep_immutable=deep_immutable, name=name) node = self._create_from_single_cap(cap) - if node: - self._node_cache[memokey] = node # note: WeakValueDictionary - else: + if node is None: # don't cache UnknownNode node = UnknownNode(writecap, readcap, deep_immutable=deep_immutable, name=name) + elif node.is_mutable(): + self._node_cache[memokey] = node # note: WeakValueDictionary if self.blacklist: si = node.get_storage_index()