← Back to team overview

maas-devel team mailing list archive

Re: Nonce already used

 

Untested, AFAIK, but seems like a reasonable fix for collision.

lp:~lutostag/maas/1.5+nonce-generation-fix

Some initial unscientific benchmarking I had done to determine if this
would cost us:

Jul 01 18:00:13 <rharper>   (foudres) maas % python nonce_bench.py
Jul 01 18:00:13 <rharper>   Benchmarking generate_nonce_uuid
Jul 01 18:00:13 <rharper>   Benchmarking generate_nonce_rand(length=128)
Jul 01 18:00:13 <rharper>   100000 iterations of
generate_nonce_rand(length=128): 0:00:58.942007
Jul 01 18:00:13 <rharper>   100000 iterations of generate_nonce_uuid:
0:00:07.487604
Jul 01 18:00:36 <rharper>   nearly a minute to generate 100k nonces via the
google oath method versus uuid.uuid4()



Ryan


On Thu, Jul 10, 2014 at 8:46 PM, Julian Edwards <
julian.edwards@xxxxxxxxxxxxx> wrote:

> On 11/07/14 08:21, Ryan Harper wrote:
> > There is an existing bug[1] and some nonce-cleanup changes coming (maas
> > will run nonce cleanup once a day IIRC).  In our heavily utilized MAAS
> > in OIL, it's not enough.
> >
> > The 8 character nonce produces way too many collisions, we generated 65k
> > unique nonces in 30 minutes.
> >
> > Greg (on CC) had a branch that replaced the none generator with
> > uuid.uuid4() which runs just as fast, but creates longer unique strings.
> >
> >
> > 1. https://bugs.launchpad.net/maas/+bug/1190986
>
> Can you point me at the branch please?  It's worth getting into the
> 1.6.0 release, especially if it helps the OIL.
>

Follow ups

References