]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
comment out some verbose log messages, add commented-out new ones
authorBrian Warner <warner@allmydata.com>
Wed, 18 Apr 2007 03:25:52 +0000 (20:25 -0700)
committerBrian Warner <warner@allmydata.com>
Wed, 18 Apr 2007 03:25:52 +0000 (20:25 -0700)
src/allmydata/download.py
src/allmydata/upload.py

index e668dde80d28e3ba97cc075de59b39e927181150..44076cafd7e98a36e863bd6a45bf568a139e100b 100644 (file)
@@ -105,8 +105,22 @@ class ValidatedBucket:
         except (hashtree.BadHashError, hashtree.NotEnoughHashesError):
             # log.WEIRD: indicates undetected disk/network error, or more
             # likely a programming error
-            log.msg("hash failure in shnum=%d on %s" % (self.sharenum,
-                                                        self.bucket))
+            log.msg("hash failure in block=%d, shnum=%d on %s" %
+                    (blocknum, self.sharenum, self.bucket))
+            #log.msg(" block length: %d" % len(blockdata))
+            #log.msg(" block hash: %s" % idlib.b2a_or_none(blockhash)) # not safe
+            #log.msg(" block data: %r" % (blockdata,))
+            #log.msg(" root hash: %s" % idlib.b2a(self._roothash))
+            #log.msg(" share hash tree:\n" + self.share_hash_tree.dump())
+            #log.msg(" block hash tree:\n" + self.block_hash_tree.dump())
+            #lines = []
+            #for i,h in sorted(sharehashes):
+            #    lines.append("%3d: %s" % (i, idlib.b2a_or_none(h)))
+            #log.msg(" sharehashes:\n" + "\n".join(lines) + "\n")
+            #lines = []
+            #for i,h in enumerate(blockhashes):
+            #    lines.append("%3d: %s" % (i, idlib.b2a_or_none(h)))
+            #log.msg(" blockhashes:\n" + "\n".join(lines) + "\n")
             raise
 
         # If we made it here, the block is good. If the hash trees didn't
index ca5c72f51959d70de8dfe42715581b92f52178d5..62fd5d79e951849ec1f1d39cda4a1d5cc73bc168 100644 (file)
@@ -51,7 +51,7 @@ class PeerTracker:
         return d
         
     def _got_reply(self, (alreadygot, buckets)):
-        log.msg("%s._got_reply(%s)" % (self, (alreadygot, buckets)))
+        #log.msg("%s._got_reply(%s)" % (self, (alreadygot, buckets)))
         self.buckets.update(buckets)
         return (alreadygot, set(buckets.keys()))
 
@@ -200,7 +200,7 @@ class FileUploader:
         # sets into sets.Set on us, even when we're using 2.4
         alreadygot = set(alreadygot)
         allocated = set(allocated)
-        log.msg("%s._got_response(%s, %s, %s): self.unallocated_sharenums: %s, unhandled: %s" % (self, (alreadygot, allocated), peer, shares_we_requested, self.unallocated_sharenums, shares_we_requested - alreadygot - allocated))
+        #log.msg("%s._got_response(%s, %s, %s): self.unallocated_sharenums: %s, unhandled: %s" % (self, (alreadygot, allocated), peer, shares_we_requested, self.unallocated_sharenums, shares_we_requested - alreadygot - allocated))
         self.unallocated_sharenums -= alreadygot
         self.unallocated_sharenums -= allocated
 
@@ -208,7 +208,7 @@ class FileUploader:
             self.used_peers.add(peer)
 
         if shares_we_requested - alreadygot - allocated:
-            log.msg("%s._got_response(%s, %s, %s): self.unallocated_sharenums: %s, unhandled: %s HE'S FULL" % (self, (alreadygot, allocated), peer, shares_we_requested, self.unallocated_sharenums, shares_we_requested - alreadygot - allocated))
+            #log.msg("%s._got_response(%s, %s, %s): self.unallocated_sharenums: %s, unhandled: %s HE'S FULL" % (self, (alreadygot, allocated), peer, shares_we_requested, self.unallocated_sharenums, shares_we_requested - alreadygot - allocated))
             # Then he didn't accept some of the shares, so he's full.
             self.usable_peers.remove(peer)