when using puma in clustered mode (i.e. it forks a child) if that child process has a Process.span, popen, system or (backtick) call when that sub process of the child exists, it appears some file descriptors are inheriting and being closed resulting in non deterministic behaviour. Its behaving differeently than MRI 2.1.0
test case to see effect
Could you setup a Rails app that shows it? It makes it easier for us to reproduce because it also minimizes any chance of us screwing up reproducing the problem.
start with puma -w 2 (2 workers) then hit the localhsot and use the link to 'slow'
So I just tried to run the repro, but it fails with this exception:
No such file or directory - /Users/dirkjan/Code/haml_issue/config/database.yml (Errno::ENOENT)
Can I just create a default database.yml file? Any reason it isn't included in the repro?
i pushed it up apparently it was in .gitignore by mistake. do a pull and you should be good to go
No, I haven't had much time to further dig into this. In the initial digging I did I was more surprised that it works in MRI, since MRI also sets close_on_exec on file descriptors by default.