[tahoe-lafs-trac-stream] [tahoe-lafs] #1540: MDMF: exception in unpack_checkstring being dropped

tahoe-lafs trac at tahoe-lafs.org
Fri Sep 23 14:14:18 PDT 2011


#1540: MDMF: exception in unpack_checkstring being dropped
--------------------------+-------------------------
 Reporter:  davidsarah    |          Owner:  kevan
     Type:  defect        |         Status:  new
 Priority:  major         |      Milestone:  1.9.0
Component:  code-mutable  |        Version:  1.9.0a1
 Keywords:  error mdmf    |  Launchpad Bug:
--------------------------+-------------------------
 Split from #1534.

 davidsarah wrote:
 > layout.py defines:
 {{{
 def unpack_checkstring(checkstring):
     cs_len = struct.calcsize(PREFIX)
     version, seqnum, root_hash, IV = struct.unpack(PREFIX,
 checkstring[:cs_len])
     if version != 0: # TODO: just ignore the share
         raise UnknownVersionError("got mutable share version %d, but I
 only understand version 0" % version)
     return (seqnum, root_hash, IV)
 }}}

 > but it is called by [source:src/allmydata/mutable/publish.py at 5231#L1105]
 in a context that doesn't seem to be specific to SDMF. Why doesn't that
 raise an {{{UnknownVersionError}}}?

 kevan wrote:
 > The caller in publish handles the case in which the remote write fails
 (e.g., because of an uncoordinated write error, share corruption, or
 something else). It's possible that we don't have tests to exercise that,
 or that the exception is getting lost in the deferred chain somewhere.
 I'll take a look at it.
 [...]
 > It seems that both of these contribute to the missing exception. [http
 ://tahoe-lafs.org/trac/tahoe-lafs/attachment/ticket/1534/1534-dropped-
 error-and-tests.darcs.patch] tweaks the control flow in the publisher a
 little bit so the exceptions don't get hidden, and then adds a test to
 exercise the code for MDMF files. {{{UnknownVersionError}}} still doesn't
 get raised, though, since the MDMF checkstring is shorter than the SDMF
 checkstring and causes {{{struct.unpack}}} to give up before the version
 can be extracted and checked. I'll work on a patch to make the new test
 pass.

-- 
Ticket URL: <http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1540>
tahoe-lafs <http://tahoe-lafs.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list