Clean up state passer state and tests #39
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 bewait()
ed on immediately after the reexec. POSIX leaves the option (which Linux exercises) to preserve the SIGCHLD handler asSIG_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