]> 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:32:42 +0000 (01:32 +1100)
commitfbf47b82c6f102276fe89db9e7d648f9196108ca
tree455a8dd2239a6597c49e2cf094aef956cc8ef20b
parentd438670d38ce464d6211ba79ed10616e15c709fb
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