mantl / mesos-consul

Mesos to Consul bridge for service discovery
Apache License 2.0
338 stars 95 forks source link

mesos-consul doesn't de-register inactive services after restart #15

Closed ryane closed 8 years ago

ryane commented 9 years ago

When mesos-consul starts up, it does not know about any of the services it may have previously registered. This can result in orphaned, seemingly duplicate services in consul. mesos-consul needs a way to identify services that it had previously registered so that it can properly deregister them if they are no longer active.

stevendborrelli commented 8 years ago

Any thoughts about using a consul TTL for each service? That way consul can prune services that are not updated.

Maybe set the TTL to X times the refresh cycle, and mesos-consul just re-registers every time.

[edit] It looks like the service ttl is just to mark it as critical, not to deregister it: https://github.com/hashicorp/consul/blob/4a9b91f2a2021efe256005d433ffe52b3e8eac06/command/agent/check.go#L244

There is an issue to have true TTL's, like etcd: https://github.com/hashicorp/consul/issues/679

ryane commented 8 years ago

For now, though, @ChrisAubuchon has already addressed this particular issue starting with commit https://github.com/CiscoCloud/mesos-consul/commit/9529507ce0ae24963efc7865ace297fbc528f030.