Close stdout and stderr in syslogger

From: Святослав Ермилин <munakoiso(at)yandex-team(dot)ru>
To: Дмитрий Сарафанников <dsarafan(at)yandex-team(dot)ru>, Андрей Бородин <x4mmm(at)yandex-team(dot)ru>, pgsql-hackers(at)lists(dot)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Close stdout and stderr in syslogger
Date: 2019-09-12 11:10:26
Message-ID: 816801568286616@myt5-bd00a25f9194.qloud-c.yandex.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers



Hi!


 


Few months ago we have encountered situation when some quite big open log files were open by Postres despite being deleted.


This affects free space caluculation in out managed PostgreSQL instances.


Currently I'm investigating this issue.


We traced some roots to unclosed descriptors in Perl code of postgresql-common [0], but we still face some unclosed descriptors pointing to log file.


 


Debian tools from postgresql-common starts pg_ctl piped to logfile. Descriptor is piped to logfile and block it for delete.


That is why we can't delete logfile.1 after logrotate.


And after second logrotate logfile.1 is in "deleted" status, but can't be deleted in fact.


 


Here I apply path with possible solution. In this patch stdout and stderr pipes are just closed in syslogger.


 


--


Sviatoslav Ermilin


Yandex


 


[0] https://salsa.debian.org/postgresql/postgresql-common/commit/580aa0677edc222ebaf6e1031cf3929f847f27fb

Attachment Content-Type Size
unknown_filename text/html 1.1 KB
0001-Close-stderr-and-stdout-in-syslogger.patch text/x-diff 1.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2019-09-12 11:18:44 Re: [HACKERS] [PATCH] pageinspect function to decode infomasks
Previous Message vignesh C 2019-09-12 10:48:36 Re: psql - improve test coverage from 41% to 88%