[tahoe-lafs-trac-stream] [tahoe-lafs] #1812: parse_abbreviated_size doesn't accept T for terabytes (and other quibbles with the regex it uses)

tahoe-lafs trac at tahoe-lafs.org
Thu Dec 27 20:04:11 UTC 2012


#1812: parse_abbreviated_size doesn't accept T for terabytes (and other quibbles
with the regex it uses)
-------------------------+-------------------------------------------------
     Reporter:           |      Owner:  zancas
  davidsarah             |     Status:  new
         Type:  defect   |  Milestone:  1.10.0
     Priority:  normal   |    Version:  1.9.2
    Component:  code     |   Keywords:  reserved_space storage error
   Resolution:           |  usability review-needed
Launchpad Bug:           |
-------------------------+-------------------------------------------------
Changes (by davidsarah):

 * keywords:  reserved_space storage error usability test-needed review-
     needed => reserved_space storage error usability review-needed
 * owner:  warner => zancas
 * milestone:  soon => 1.10.0


Old description:

> stercor tried to use "{{{reserved_space = 1.5TiB}}}" in {{{tahoe.cfg}}}.
> This failed and used a {{{reserved_space}}} of 0 bytes (as shown on the
> server status page), because {{{T}}} is not recognized by
> [source:git/src/allmydata/util/abbreviate.py at 39a41f1d#L58
> parse_abbreviated_size in allmydata.util.abbreviate].
>
> Note that the error due to an unparseable size is silent and only
> reported in the foolscap log. Continuing with a {{{reserved_space}}} of 0
> bytes is a rather unhelpful failure mode. The code responsible for that
> is at [source:git/src/allmydata/client.py at 32377469#L248].
>
> The regex is {{{r"^(\d+)([kKmMgG]?[iB]?[bB]?)$"}}}, which also allows
> strings ending in {{{"BB"}}} or {{{"Bb"}}}; I don't think that allowing
> the repeated B was intentional.

New description:

 stercor tried to use "{{{reserved_space = 1.5TiB}}}" in {{{tahoe.cfg}}}.
 This failed and used a {{{reserved_space}}} of 0 bytes (as shown on the
 server status page), because {{{T}}} is not recognized by
 [source:git/src/allmydata/util/abbreviate.py at 39a41f1d#L58
 parse_abbreviated_size in allmydata.util.abbreviate].

 Note that the error due to an unparseable size is silent and only reported
 in the foolscap log. Continuing with a {{{reserved_space}}} of 0 bytes is
 a rather unhelpful failure mode. The code responsible for that is at
 [source:git/src/allmydata/client.py at 32377469#L248].

 The regex is {{{r"^(\d+)([kKmMgG]?[iB]?[bB]?)$"}}}, which also allows
 strings ending in {{{"BB"}}} or {{{"Bb"}}}; I don't think that allowing
 the repeated B was intentional.

--

Comment:

 Review needed for [https://github.com/tahoe-lafs/tahoe-lafs/pull/26] (now
 with tests).

-- 
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1812#comment:4>
tahoe-lafs <https://tahoe-lafs.org>
secure decentralized storage


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