[PATCH 0/5] Prevent database error logs on duplicate mail
Stephen Finucane
stephen at that.guru
Sat Apr 18 22:09:44 AEST 2020
On Thu, 2020-04-16 at 09:29 +0800, Jeremy Kerr wrote:
> On patchwork.ozlabs.org, we see a lot of noise in the postgres logs, due
> to INSERTs with duplicate values for (project,msgid) keys. Patchwork's
> strategy for catching the resulting IntegrityError means that each of
> these is logged.
>
> Instead, this change moves to an atomic select -> insert for the Patch,
> Comment and Coverletter parsing.
These all looked sane and have been applied and backported to
stable/2.2. Note however that we rely on integerity error checking to
handle races when creating a new series [1]. I imagine this might also
be the source of some noise. I don't have any clever ideas here so if
you do, I'm all ears.
Stephen
[1] https://github.com/getpatchwork/patchwork/blob/55fb26bf5/patchwork/parser.py#L1091-L1174
> Jeremy Kerr (5):
> tests: Add duplicate mail test
> tests: ensure we don't see database errors during duplicate insert
> parser: prevent IntegrityErrors
> parser: don't trigger database IntegrityErrors on duplicate comments
> parser: don't trigger database IntegrityErrors on duplicate
> coverletters
>
> patchwork/parser.py | 20 ++++++-----
> patchwork/tests/test_parser.py | 64 ++++++++++++++++++++++++++++++++++
> 2 files changed, 75 insertions(+), 9 deletions(-)
>
More information about the Patchwork
mailing list