Re: csvlog gets crazy when csv file is not writable

From: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: cyberdemn(at)gmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: csvlog gets crazy when csv file is not writable
Date: 2018-08-21 09:18:55
Message-ID: CA+q6zcUer3kfbkya8btE_AME+fPnd=oJHmoB_gaj=5dfafRC4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> On Tue, 21 Aug 2018 at 04:23, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
> > On Mon, Aug 20, 2018 at 03:55:01PM +0200, Alexander Kukushkin wrote:
> > If for some reason postgres can't open 'postgresql-%Y-%m-%d.csv' file
> > for writing, it gets mad and outputs a few thousands of lines to
> > stderr:
> >
> > 2018-08-20 15:40:46.920 CEST [22069] PANIC: could not open log file
>
> Ah, this log message could be changed to be simply "could not open
> file", the file name offers enough context...

Yeah, I had the same idea while investigating this, that it would be easier
just to change this log message and remove the filename completely or format
the message somehow without using va_list.

> > And so on. ERRORDATA_STACK_SIZE is presented in the output 3963 times
> >
> > Sure, it is entirely my fault, that csv file is not writable, but such
> > avalanche of PANIC lines is really scary.
>
> Yeah, this is a recursion in logfile_open -> open_csvlogfile. With
> stderr there is a much better effort, where the server just quits with a
> FATAL if the log file cannot be opened in SysLogger_Start.

I also wonder if there are any strong reasons why in the case of errors with
csv log file behaviour is different, maybe it's possible to unify them?

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Rowley 2018-08-21 11:12:34 Re: BUG #15343: Segmentation fault using pg_dump with --exclude-table if table contains identity column
Previous Message Michael Paquier 2018-08-21 06:24:07 Re: BUG #15343: Segmentation fault using pg_dump with --exclude-table if table contains identity column