mesos-consul doesn't de-register inactive services after restart
Closed this issue · 2 comments
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.
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: hashicorp/consul#679
For now, though, @ChrisAubuchon has already addressed this particular issue starting with commit 9529507.