Re: Better client reporting for "immediate stop" shutdowns

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Better client reporting for "immediate stop" shutdowns
Date: 2020-12-24 18:04:44
Message-ID: 847983.1608833084@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> writes:
> On Tue, Dec 22, 2020 at 11:02 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-12-24 22:07:43 Re: Preventing hangups in bgworker start/stop during DB shutdown
Previous Message Tom Lane 2020-12-24 16:13:50 Re: Preventing hangups in bgworker start/stop during DB shutdown