Re: Better client reporting for "immediate stop" shutdowns - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Better client reporting for "immediate stop" shutdowns
Date
Msg-id 847983.1608833084@sss.pgh.pa.us
Whole thread Raw
In response to Re: Better client reporting for "immediate stop" shutdowns  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Preventing hangups in bgworker start/stop during DB shutdown
Next
From: Tom Lane
Date:
Subject: Re: Preventing hangups in bgworker start/stop during DB shutdown