From 99ebf6eaf589f9d56b4a7b30614b47b1b2d8e2f8 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Fri, 27 Feb 2009 01:04:26 -0700 Subject: [PATCH] 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 --- src/allmydata/mutable/servermap.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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. -- 2.45.2