From f95e9b5964be3e729eeee3fb04fe947e7ef26d8b Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Mon, 23 Feb 2009 22:14:05 -0700 Subject: [PATCH] immutable/checker.py: trap ShareVersionIncompatible too. Also, use f.check instead of examining the value returned by f.trap, because the latter appears to squash exception types down into their base classes (i.e. since ShareVersionIncompatible is a subclass of LayoutInvalid, f.trap(Failure(ShareVersionIncompatible)) == LayoutInvalid). All this resulted in 'incompatible' shares being misclassified as 'corrupt'. --- src/allmydata/immutable/checker.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/allmydata/immutable/checker.py b/src/allmydata/immutable/checker.py index 22297be6..74343639 100644 --- a/src/allmydata/immutable/checker.py +++ b/src/allmydata/immutable/checker.py @@ -141,14 +141,15 @@ class Checker(log.PrefixingLogMixin): rrefutil.ServerFailure, layout.LayoutInvalid, layout.RidiculouslyLargeURIExtensionBlock, + layout.ShareVersionIncompatible, download.BadOrMissingHash, download.BadURIExtensionHashValue) - if failtype is DeadReferenceError: + if f.check(DeadReferenceError): return (False, sharenum, 'disconnect') - elif failtype is rrefutil.ServerFailure: + elif f.check(rrefutil.ServerFailure): return (False, sharenum, 'failure') - elif failtype is layout.ShareVersionIncompatible: + elif f.check(layout.ShareVersionIncompatible): return (False, sharenum, 'incompatible') else: return (False, sharenum, 'corrupt') -- 2.45.2