stripe/einhorn — pull request #39 by ebroder (2014-08-19 06:53:10+00:00)
Title: Clean up state passer state and tests

Stop recording state passers as children (they exit immediately so they don't really count), and update the tests to pass on Ruby 2.0 and 2.1

I'm still a little concerned that they weren't getting cleaned up automatically.

As far as I can tell, POSIX specifies that signal handlers get reset to their default on exec when there was previously an explicit handler set; for `SIGCHLD`, this should result in dead children staying around as zombies until they're reaped by the parent. Meanwhile, the einhorn main loop should have more or less reaped any children that could be `wait()`ed on immediately after the reexec. POSIX leaves the option (which Linux exercises) to preserve the SIGCHLD handler as `SIG_IGN` if it's explicitly set to that, but einhorn doesn't do that - it sets an explicit handler.

Can einhorn reap a child after spawning the state-passer but before re-execing? Is it possible that `Einhorn.can_safely_reload?` somehow results in other processes getting reaped?

Also, getting the tests to pass was kind of ridiculous. I'm blown away that 1.8.7, 1.9.3, 2.0.0, and 2.1 all come up with different YAML serializations of the same hash

r? @antifuchs