Re: Close stdout and stderr in syslogger

From: Святослав Ермилин <munakoiso(at)yandex-team(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Дмитрий Сарафанников <dsarafan(at)yandex-team(dot)ru>, Андрей Бородин <x4mmm(at)yandex-team(dot)ru>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Close stdout and stderr in syslogger
Date: 2019-10-03 12:30:40
Message-ID: 580021570105830@iva5-c4dd0484b46b.qloud-c.yandex.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> In any case, the proposed patch almost certainly introduces new
> problems, in that you dropped the fcloses's into code that
> executes repeatedly.

I guess it's better to place fclose() right after successful syslogger start.
In that case we close descriptors just one time. But it's enough to solve the problem.
Developers who debug syslogger generally should see problems before we close descriptors.
In other case they can edit code of syslogger.

There is another way to solve this problem:
We can give users the opportunity to leave or close descriptors.
I.e. config switch for this. But I think that it's too complicated.

One can reproduce the problem by following steps in previous messages.

_________

Regards, Sviatoslav Ermilin

Attachment Content-Type Size
0001-Close-stderr-and-stdout-in-syslogger.patch text/x-diff 967 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message REIX, Tony 2019-10-03 13:22:54 RE: Shared Memory: How to use SYSV rather than MMAP ?
Previous Message Thomas Munro 2019-10-03 12:25:54 Re: Collation versioning