pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: exclusion@gmail.com
Subject: BUG #15492: pg_cancel_backend(pg_backend_pid()) returns true sporadically
Date: Thu, 08 Nov 2018 04:30:05 +0000
Message-ID: <15492-9b79ce7d1e0687a9@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15492
Logged by:          Alexander Lakhin
Email address:      exclusion@gmail.com
PostgreSQL version: 11.0
Operating system:   Windows 2012 R2
Description:        

When performing `make standbycheck` I get sporadic failure:

============== running regression test queries        ==============
test hs_standby_check         ... ok
test hs_standby_allowed       ... ok
test hs_standby_disallowed    ... ok
test hs_standby_functions     ... FAILED

======================
 1 of 4 tests failed. 
======================

***
C:/tmp/postgrespro-standard-10.6.1/src/test/regress/expected/hs_standby_functions.out	Wed
Nov  7 01:14:03 2018
---
C:/tmp/postgrespro-standard-10.6.1/src/test/regress/results/hs_standby_functions.out	Wed
Nov  7 06:36:47 2018
***************
*** 37,40 ****
  
  -- suicide is painless
  select pg_cancel_backend(pg_backend_pid());
! ERROR:  canceling statement due to user request
--- 37,44 ----

  -- suicide is painless
  select pg_cancel_backend(pg_backend_pid());
!  pg_cancel_backend 
! -------------------
!  t
! (1 row)
! 

======================================================================

In fact, I see the same when I just do in psql (using EnterpriseDB's
PostgreSQL 11 for Windows):

postgres=# select pg_cancel_backend(pg_backend_pid());
ERROR:  canceling statement due to user request
postgres=# select pg_cancel_backend(pg_backend_pid());
ERROR:  canceling statement due to user request
postgres=# select pg_cancel_backend(pg_backend_pid());
ERROR:  canceling statement due to user request
postgres=# select pg_cancel_backend(pg_backend_pid());
 pg_cancel_backend
-------------------
 t
(1 row)


postgres=# select pg_cancel_backend(pg_backend_pid());
 pg_cancel_backend
-------------------
 t
(1 row)


postgres=# select pg_cancel_backend(pg_backend_pid());
ERROR:  canceling statement due to user request
postgres=#

I couldn't reproduce it on Linux, though.
So if it's an expected behaviour, shouldn't the hs_standby_functions check
be fixed?
(I don't understand what is the point of this pg_cancel_backend call.)



view thread (10+ messages)  latest in thread

Message-ID: <15492-9b79ce7d1e0687a9@postgresql.org>
Permalink:  ../15492-9b79ce7d1e0687a9@postgresql.org/
Also on:    postgresql.org/message-id/15492-9b79ce7d1e0687a9@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, exclusion@gmail.com
  Subject: Re: BUG #15492: pg_cancel_backend(pg_backend_pid()) returns true sporadically
  In-Reply-To: <15492-9b79ce7d1e0687a9@postgresql.org>
  References: <15492-9b79ce7d1e0687a9@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox