Re: Introduce "log_connection_stages" setting.

From: Jacob Champion <jchampion(at)timescale(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Sergey Dudoladov <sergey(dot)dudoladov(at)gmail(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Euler Taveira <euler(at)eulerto(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Introduce "log_connection_stages" setting.
Date: 2023-03-02 23:02:18
Message-ID: 9b944c52-85d9-bc1d-99f1-35d9eaef1bfb@timescale.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3/2/23 14:56, Tom Lane wrote:
> Jacob Champion <jchampion(at)timescale(dot)com> writes:
>> If I've understood Tom correctly in [1], both of these guc_mallocs
>> should be using a loglevel less than ERROR, to avoid forcing a
>> postmaster exit when out of memory. (I used WARNING in that thread
>> instead, which seemed to be acceptable.)
>
> Actually, preferred practice is as seen in e.g. check_datestyle:
>
> myextra = (int *) guc_malloc(LOG, 2 * sizeof(int));
> if (!myextra)
> return false;
> myextra[0] = newDateStyle;
> myextra[1] = newDateOrder;
> *extra = (void *) myextra;
>
> which gives the guc.c functions an opportunity to manage the
> failure.

Ah, thanks for the correction. (My guc_strdup(WARNING, ...) calls may
need to be cleaned up too, then.)

--Jacob

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2023-03-02 23:24:50 Re: Memory leak from ExecutorState context?
Previous Message Jehan-Guillaume de Rorthais 2023-03-02 22:57:21 Re: Memory leak from ExecutorState context?