← Back to team overview

maas-devel team mailing list archive

Re: Race in Node.acquire()?

 

On 04/30/2014 04:50 AM, Julian Edwards wrote:
See https://bugs.launchpad.net/maas/+bug/1314409

Unless I am way off with my analysis, it looks like two "acquire()"
operations from separate clients got allocated the same Node.

I am left wondering if this is anything to do with Django's useless
default DB isolation level?

Although AFAIK Django doesn't support optimistic locking, there is support —since Django 1.4— for pessimistic locking which I think is what we should be explicitly using here to protect such a critical code path (https://docs.djangoproject.com/en/dev/ref/models/querysets/#select-for-update).

R.




Follow ups

References