Re: BUG #15492: pg_cancel_backend(pg_backend_pid()) returns truesporadically - Mailing list pgsql-bugs

From Alexander Lakhin
Subject Re: BUG #15492: pg_cancel_backend(pg_backend_pid()) returns truesporadically
Date
Msg-id a5b57f72-f0d4-38d0-9a26-a03eacf4f6ae@gmail.com
Whole thread Raw
In response to Re: BUG #15492: pg_cancel_backend(pg_backend_pid()) returns true sporadically  (Magnus Hagander <magnus@hagander.net>)
List pgsql-bugs
09.11.2018 17:48, Magnus Hagander wrote:
On Fri, Nov 9, 2018 at 2:25 AM Thomas Munro <thomas.munro@enterprisedb.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@yesql.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

pgsql-bugs by date:

Previous
From: Thomas Munro
Date:
Subject: Re: BUG #15496: The application server could not be contacted
Next
From: Alexander Lakhin
Date:
Subject: Re: BUG #15492: pg_cancel_backend(pg_backend_pid()) returns truesporadically