From a36ed9b5b772482d50089625a1e5f84a697d4b50 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Mon, 28 Jan 2008 11:59:10 -0700 Subject: [PATCH] encode.py: don't record BAD log event unless there is actually a problem --- src/allmydata/encode.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/allmydata/encode.py b/src/allmydata/encode.py index 0815df93..a2878a41 100644 --- a/src/allmydata/encode.py +++ b/src/allmydata/encode.py @@ -352,8 +352,9 @@ class Encoder(object): encrypted_pieces.append('\x00' * pad_size) else: # non-tail segments should be the full segment size - log.msg("non-tail segment should be full segment size: %d!=%d" - % (length, input_chunk_size), level=log.BAD) + if length != input_chunk_size: + log.msg("non-tail segment should be full segment size: %d!=%d" + % (length, input_chunk_size), level=log.BAD) precondition(length == input_chunk_size, "length=%d != input_chunk_size=%d" % (length, input_chunk_size)) @@ -597,7 +598,7 @@ class Encoder(object): self.num_shares, self.file_size) def err(self, f): - self.log("UNUSUAL: %s: upload failed: %s" % (self, f)) + self.log("upload failed", failure=f, level=log.UNUSUAL) # we need to abort any remaining shareholders, so they'll delete the # partial share, allowing someone else to upload it again. self.log("aborting shareholders") -- 2.45.2