maas-devel team mailing list archive
-
maas-devel team
-
Mailing list archive
-
Message #01593
Re: Race in Node.acquire()?
On Wednesday 30 Apr 2014 11:24:27 Jeroen Vermeulen wrote:
> On 04/30/2014 10:24 AM, Raphaël Badin wrote:
> >> I am left wondering if this is anything to do with Django's useless
> >> default DB isolation level?
>
> Yes, it is. And Django designed its house on top of that foundation, so
> we change it at our peril.
>
> > 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-up
> > date).
> That would do it. We'd want to avoid blocking on it though, so we'd
> need to pass “nowait” and back off to a second choice if the lock failed.
Why can't we block with a timeout, like LP?
Follow ups
References