pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Kill dead-end children when there's nothing else left
Date: Thu, 14 Nov 2024 14:13:15 +0000
Message-ID: <E1tBaaw-001mW8-Oq@gemulon.postgresql.org> (raw)

Kill dead-end children when there's nothing else left

Previously, the postmaster would never try to kill dead-end child
processes, even if there were no other processes left. A dead-end
backend will eventually exit, when authentication_timeout expires, but
if a dead-end backend is the only thing that's preventing the server
from shutting down, it seems better to kill it immediately. It's
particularly important, if there was a bug in the early startup code
that prevented a dead-end child from timing out and exiting normally.

Includes a test for that case where a dead-end backend previously
prevented the server from shutting down.

Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://www.postgresql.org/message-id/a102f15f-eac4-4ff2-af02-f9ff209ec66f@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/bb861414fea31073f27aaab75a0ceaf3638d7985

Modified Files
--------------
src/backend/postmaster/postmaster.c      | 17 +++---
src/test/perl/PostgreSQL/Test/Cluster.pm | 10 +++-
src/test/postmaster/meson.build          |  1 +
src/test/postmaster/t/002_start_stop.pl  | 98 ++++++++++++++++++++++++++++++++
4 files changed, 116 insertions(+), 10 deletions(-)



Message-ID: <E1tBaaw-001mW8-Oq@gemulon.postgresql.org>
Permalink:  ../E1tBaaw-001mW8-Oq@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tBaaw-001mW8-Oq@gemulon.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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Kill dead-end children when there's nothing else left
  In-Reply-To: <E1tBaaw-001mW8-Oq@gemulon.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