From: Brian Warner Date: Mon, 7 Jul 2008 07:17:41 +0000 (-0700) Subject: mutable: if there are no servers available, return an error, rather than hanging... X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/uri/frontends/install.html?a=commitdiff_plain;h=91c7e0f6897827fe1b55535ab5cdf634533078a9;p=tahoe-lafs%2Ftahoe-lafs.git mutable: if there are no servers available, return an error, rather than hanging forever --- diff --git a/src/allmydata/mutable/servermap.py b/src/allmydata/mutable/servermap.py index 4fbb83f4..6fe605ca 100644 --- a/src/allmydata/mutable/servermap.py +++ b/src/allmydata/mutable/servermap.py @@ -461,6 +461,12 @@ class ServermapUpdater: self._queries_outstanding.add(peerid) self._do_query(ss, peerid, self._storage_index, self._read_size) + if not peerlist: + # there is nobody to ask, so we need to short-circuit the state + # machine. + d = defer.maybeDeferred(self._check_for_done, None) + d.addErrback(self._fatal_error) + # control flow beyond this point: state machine. Receiving responses # from queries is the input. We might send out more queries, or we # might produce a result.