garden20/gardener — pull request #18 by browndav (2014-09-16 18:46:43+00:00)
Title: Gardener: never give up on a module

We've observed gardener "giving up" on a malfunctioning service in production; this essentially guarantees that the module will stop functioning. If gardener were to keep trying, there's at least some possibility that portions of that module will keep working, e.g. along different code paths, or when the module is provided with input that doesn't trigger the crash/exit.

The `spinSleepTime` option for `forever` is poorly documented, but at least one string in the codebase leads me to believe that `forever` will give up on a service if `minUptime` isn't reached *and* `spinSleepTime` is undefined:

https://github.com/nodejitsu/forever/blob/master/lib/forever/cli.js#L229

This patch simply sets `spinSleepTime`, so `forever` (and thus, `gardener`) will wait for two seconds and retry rather than give up on the module entirely.

@ryanramage: This patch is on top of Gareth's https://github.com/garden20/gardener/pull/16. I have a tree with all of this stuff manually merged in, but don't seem to have commit access. Would you mind taking a look at moth of these PRs and either merging or giving me commit access so I can merge?

We're going to test this stuff thoroughly today, and then were thinking it'd make sense to do a 1.1.0 release.

Thanks!