Closed ryane closed 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
For now, though, @ChrisAubuchon has already addressed this particular issue starting with commit https://github.com/CiscoCloud/mesos-consul/commit/9529507ce0ae24963efc7865ace297fbc528f030.
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.