airbnb / nerve

A service registration daemon that performs health checks; companion to airbnb/synapse
MIT License
942 stars 151 forks source link

report_down when stopping ZK reporter. #64

Closed narbsy closed 9 years ago

narbsy commented 9 years ago

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!

igor47 commented 9 years ago

because we use ephemeral nodes, you would eventually get this anyway after the timeout interval. however, this is indeed the correct behavior. thanks!

narbsy commented 9 years ago

Ah, right :) good point. This is nice to not have to wait for the timeout.

Thanks!