In this code block, Dante naively closes all file descriptors when it forks. For some reason, this loop iterates over an excessively large number of descriptors with recent kernels or docker versions. When starting dante inside Docker, the process pegs at 100% and when strace-ing I get:
In this code block, Dante naively closes all file descriptors when it forks. For some reason, this loop iterates over an excessively large number of descriptors with recent kernels or docker versions. When starting dante inside Docker, the process pegs at 100% and when strace-ing I get:
After about 10 minutes and wasting CPU cycles, it somehow manages to iterate the whole file descriptor domain.
A workaround is to set a reasonable nofile ulimit for the service. I think that Dante should close to the new
close_range
syscall.I will submit a PR to fix this, but I want a bug to link to.