]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
mutable: if there are no servers available, return an error, rather than hanging...
authorBrian Warner <warner@lothar.com>
Mon, 7 Jul 2008 07:17:41 +0000 (00:17 -0700)
committerBrian Warner <warner@lothar.com>
Mon, 7 Jul 2008 07:17:41 +0000 (00:17 -0700)
src/allmydata/mutable/servermap.py

index 4fbb83f40ac06fe1c1f0dcda37d4f331bd158518..6fe605ca06ccc9566173b7cd2dfe85c7cd08f28c 100644 (file)
@@ -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.