pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Better client reporting for "immediate stop" shutdowns
Date: Thu, 24 Dec 2020 13:04:44 -0500
Message-ID: <847983.1608833084@sss.pgh.pa.us> (raw)
In-Reply-To: <CALj2ACV4+N5iOUFSv7SZzGMFBUo8Xoqb9QJmz+2WoHAESUSPUg@mail.gmail.com>
References: <559291.1608587013@sss.pgh.pa.us>
	<CALj2ACV0WBjHkX-+iHO1kNYSBbDYH_6cygA6rrP91epNRF9xBw@mail.gmail.com>
	<CABUevEx1Obz9cR7O+RMoHe8QFcG_iC2znof3hJ54oKN4Qvn2Kw@mail.gmail.com>
	<615956.1608658320@sss.pgh.pa.us>
	<CALj2ACV4+N5iOUFSv7SZzGMFBUo8Xoqb9QJmz+2WoHAESUSPUg@mail.gmail.com>

Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> writes:
> On Tue, Dec 22, 2020 at 11:02 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> There might be an argument for emitting the "unexpected SIGQUIT"
>> text if we find garbage in sigquit_reason.  Any thoughts about that?

> Although I can't think of any case now, IMHO we can still have a
> default case(we may or may not hit it) in the switch with a message
> something like  "terminating connection due to unexpected SIGQUIT".

I don't really want to add a default case just on speculation.  We
generally prefer to avoid writing a default in a switch that's supposed
to cover all values of an enum type, because without the default most C
compilers will warn you if you omit a value, whereas with the default
they won't.  Admittedly, it's unlikely someone would add a new
QuitSignalReason and forget to update this code, but still it's not
really project style to do it like that.  I don't think there's enough
risk here to go against the style.

Hence, pushed it like that.

			regards, tom lane





view thread (14+ messages)  latest in thread

Message-ID: <847983.1608833084@sss.pgh.pa.us>
Permalink:  ../847983.1608833084@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/847983.1608833084@sss.pgh.pa.us

 · 

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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bharath.rupireddyforpostgres@gmail.com, magnus@hagander.net, pgsql-hackers@lists.postgresql.org
  Subject: Re: Better client reporting for "immediate stop" shutdowns
  In-Reply-To: <847983.1608833084@sss.pgh.pa.us>

* 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