mozilla-services/circus — pull request #832 by wynnw (2014-09-15 22:44:29+00:00)
Title: various fixes for the addwatcher command and rlimit settings

- change the rlimit json value to indicate RLIM_INFINITY to None to
avoid any platform weirdness with using -1 as that value, which
isn't guaranteed. A convenience function in config.py handles that
logic
- have the addwatcher command build an rlimits dict to pass into the
arbiter/watcher in order to get those values actually used (as they
weren't before)
- make sure to catch ValueError in addition to OSError when starting
a process as ValueError will be raised if something goes wrong with
the setrlimit calls, and otherwise we get in a bad process retry
loop that avoids the throttling logic
- add special logic for setting the NOFILE limit that will assume
that the caller wants to use the configured kernel limit if they
pass a null value in order to use RLIMI_INFINITY. See the comment
for more details.