Skip to content

Current maximum number of open files not set high enough #157

@watson6282

Description

@watson6282

The current maximum number of open files (RLIMIT_NOFILE) is not being set high enough. In some cases, certain combinations of the fanout and the current open file limit leads to pdsh dumping core after reaching its maximum number of open files. This code:

int nfds = (2 * opt->fanout) + 32;

does end up setting enough file descriptors in a case like this (ssh rcmd, 1024 max files, 300 fanout):

quartz187 ~/pie# ulimit -Sn 1024; strace -e prlimit64 -o strace.out pdsh -f 300 -w "equartz[1-300]" echo > /dev/null; echo; cat strace.out
pdsh@quartz187: pipecmd: socketpair: Too many open files
pdsh@quartz187: pipecmd: socketpair: Too many open files
pdsh@quartz187: pipecmd: socketpair: Too many open files
pdsh@quartz187: pipecmd: socketpair: Too many open files
pdsh@quartz187: pipecmd: socketpair: Too many open files
pdsh@quartz187: pipecmd: socketpair: Too many open files
pdsh@quartz187: pipecmd: socketpair: Too many open files
pdsh@quartz187: exec cmd ssh failed for host equartz242
pdsh@quartz187: pipecmd: socketpair: Too many open files
pdsh@quartz187: pipecmd: socketpair: Too many open files
pdsh@quartz187: exec cmd ssh failed for host equartz299
pdsh@quartz187: pipecmd: socketpair: Too many open files
pdsh@quartz187: pipecmd: socketpair: Too many open files
pdsh@quartz187: exec cmd ssh failed for host equartz38
pdsh@quartz187: pipecmd: socketpair: Too many open files
pdsh@quartz187: pipecmd: socketpair: Too many open files
pdsh@quartz187: pipecmd: socketpair: Too many open files
pdsh@quartz187: pipecmd: socketpair: Too many open files
Segmentation fault

prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=RLIM64_INFINITY, rlim_max=RLIM64_INFINITY}) = 0
prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1024, rlim_max=125*1024}) = 0
+++ killed by SIGSEGV (core dumped) +++

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions