Re: BUG #15492: pg_cancel_backend(pg_backend_pid()) returns true sporadically

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15492: pg_cancel_backend(pg_backend_pid()) returns true sporadically
Date: 2018-11-12 03:40:00
Message-ID: a5b57f72-f0d4-38d0-9a26-a03eacf4f6ae@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

09.11.2018 17:48, Magnus Hagander wrote:
> On Fri, Nov 9, 2018 at 2:25 AM Thomas Munro
> <thomas(dot)munro(at)enterprisedb(dot)com <mailto:thomas(dot)munro(at)enterprisedb(dot)com>>
> wrote:
>
> We saw a variant of this problem on appveyor (a Windows build-bot)
> when testing Daniel's patch to add an optional message (search for
> "timing"), and it was fixed as part of that patch, for the new code in
> that patch:
>
> https://www.postgresql.org/message-id/flat/C2C7C3EC-CC5F-44B6-9C78-637C88BD7D14(at)yesql(dot)se
>
> Perhaps other pre-existing tests need similar treatment?
>
>
> Ah yes, that seems to be the same thing, and yes that seem like a
> reasonalbe solution. So something like:
> +select case
> +       when pg_cancel_backend(pg_backend_pid())
> +       then pg_sleep(60)
> +end;
>  
> Alexander, can you check to see if making that change solves the issue
> on your machine?
Yes, after applying the attached patch, the issue is gone.

Best regards,
Alexander

Attachment Content-Type Size
fix-pg_cancel_backend.patch text/x-patch 1.0 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2018-11-12 03:59:59 Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation
Previous Message Amit Langote 2018-11-12 02:47:27 Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation