]> git.ipfire.org Git - thirdparty/patchwork.git/commit
parser: don't fail on multiple SeriesReferences
authorDaniel Axtens <dja@axtens.net>
Mon, 19 Feb 2018 14:34:15 +0000 (01:34 +1100)
committerDaniel Axtens <daniel.axtens@canonical.com>
Tue, 6 Mar 2018 14:24:18 +0000 (01:24 +1100)
commit5e0e06db42ffd62a7258448ea21e4a5ca5e7430b
tree142efae7671a8fe268913e595af6264acd173916
parent26e9c2a61c5d2dbd13d9e53f8547119b169e0780
parser: don't fail on multiple SeriesReferences

Parallel parsing would occasonally fail with:

patchwork.models.MultipleObjectsReturned: get() returned more than one SeriesReference -- it returned 2!

I think these are happening if you have different processes parsing
e.g. 1/3 and 2/3 simultaneously: both will have a reference to 1/3,
in the case of 1 it will be the msgid, in the case of 2 it will be
in References. So when we come to parse 3/3, .get() finds 2 and
throws the exception.

This does not fix the creation of multiple series references; it
just causes them to be ignored. We still have serious race conditions
with series creation, but I don't yet have clear answers for them.
With this patch, they will at least not stop patches from being
processed - they'll just lead to wonky series, which we already have.

Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Daniel Axtens <dja@axtens.net>
patchwork/parser.py