Re: File descriptors inherited by restore_command

2019-06-21 Thread David Steele
On 6/21/19 10:26 AM, Stephen Frost wrote: >> >>> Another possible issue is that if we allow a child process to inherit >>> all these fds it might accidentally write to them, which would be bad. >>> I know the child process can go and maliciously open and trash files if >>> it wants, but it doesn't

Re: File descriptors inherited by restore_command

2019-06-21 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > David Steele writes: > > On 6/21/19 9:45 AM, Tom Lane wrote: > >> +1 for using O_CLOEXEC on machines that have it. I don't think I want to > >> jump through hoops for machines that don't have it --- POSIX has required > >> it for some time, so

Re: File descriptors inherited by restore_command

2019-06-21 Thread Tom Lane
I wrote: > In practice, as long as we use O_CLOEXEC > for files opened by fd.c, that would eliminate the actual too-many-fds > hazard. I don't object to desultorily looking around for other places > where we might want to add it, but personally I'd be satisfied with a > patch that CLOEXEC-ifies fd

Re: File descriptors inherited by restore_command

2019-06-21 Thread Tom Lane
David Steele writes: > On 6/21/19 9:45 AM, Tom Lane wrote: >> +1 for using O_CLOEXEC on machines that have it. I don't think I want to >> jump through hoops for machines that don't have it --- POSIX has required >> it for some time, so there should be few machines in that category. > Another pos

Re: File descriptors inherited by restore_command

2019-06-21 Thread David Steele
On 6/21/19 9:45 AM, Tom Lane wrote: > David Steele writes: >> 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

Re: File descriptors inherited by restore_command

2019-06-21 Thread Tom Lane
David Steele writes: > 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 setti

File descriptors inherited by restore_command

2019-06-21 Thread David Steele
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