airbnb/nerve — pull request #64 by narbsy (2014-11-11 05:36:01+00:00)
Title: report_down when stopping ZK reporter.

While investigating using nerve & synapse at work, we stumbled across the fact that the ZK reporter doesn't automatically deregister the watched service on exit, but the etcd reporter does.

Our use case involves running a nerve instance within a docker image to get some nice automatic service discovery and a lifecycle that corresponds directly with that of the image -- if the image goes down, we want to make sure anything running within is reported as down.

I've added de-registering when stopping the ZK reporter and attempted to add a test that shows the expected lifecycle. I'm not a huge fan of it as it mocks literally everything, and is somewhat difficult to generalize to the etcd reporter as well.

Let me know what needs to be done to get this merged in. Thanks!