From: Brian Warner Date: Fri, 27 Feb 2009 08:04:26 +0000 (-0700) Subject: servermap add-lease: fix the code that's supposed to catch remote IndexErrors, I... X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/%22doc.html/readonly?a=commitdiff_plain;h=99ebf6eaf589f9d56b4a7b30614b47b1b2d8e2f8;p=tahoe-lafs%2Ftahoe-lafs.git servermap add-lease: fix the code that's supposed to catch remote IndexErrors, I forgot that they present as ServerFailures instead. This should stop the deluge of Incidents that occur when you do add-lease against 1.3.0 servers --- diff --git a/src/allmydata/mutable/servermap.py b/src/allmydata/mutable/servermap.py index 7c0918ce..7a9ccdc8 100644 --- a/src/allmydata/mutable/servermap.py +++ b/src/allmydata/mutable/servermap.py @@ -6,7 +6,7 @@ from twisted.internet import defer from twisted.python import failure from foolscap import DeadReferenceError from foolscap.eventual import eventually -from allmydata.util import base32, hashutil, idlib, log +from allmydata.util import base32, hashutil, idlib, log, rrefutil from allmydata.storage.server import si_b2a from allmydata.interfaces import IServermapUpdaterStatus from pycryptopp.publickey import rsa @@ -543,12 +543,12 @@ class ServermapUpdater: cancel_secret = self._node.get_cancel_secret(peerid) d2 = ss.callRemote("add_lease", storage_index, renew_secret, cancel_secret) - dl = defer.DeferredList([d, d2]) + dl = defer.DeferredList([d, d2], consumeErrors=True) def _done(res): [(readv_success, readv_result), (addlease_success, addlease_result)] = res if (not addlease_success and - not addlease_result.check(IndexError)): + not rrefutil.check_remote(addlease_result, IndexError)): # tahoe 1.3.0 raised IndexError on non-existant buckets, # which we ignore. Unfortunately tahoe <1.3.0 had a bug # and raised KeyError, which we report.