File descriptors inherited by restore_command

From: David Steele <david(at)pgmasters(dot)net>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: File descriptors inherited by restore_command
Date: 2019-06-21 13:37:59
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


While investigating "Too many open files" errors reported in our
parallel restore_command I noticed that the restore_command can inherit
quite a lot of fds from the recovery process. This limits the number of
fds available in the restore_command depending on the setting of system
nofile and Postgres max_files_per_process.

I was wondering if we should consider closing these fds before calling
restore_command? It seems like we could do this by forking first or by
setting FD_CLOEXEC using fcntl() or O_CLOEXEC on open() where available.

Thoughts on this? Is this something we want to change or should I just
recommend that users set nofile and max_files_per_process appropriately?



Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-06-21 13:45:32 Re: File descriptors inherited by restore_command
Previous Message Mahesh S 2019-06-21 13:28:19 Google Season of Docs