undeadlabs / discovery

An OTP application for auto-discovering services with Consul

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dead services are not getting removed

gamepoet opened this issue · comments

While using discovery for my application, it would seem that dead service instances are not getting removed.

I had two of my service running:

$ consul members
host1.example.com 192.168.0.100 alive client 0.3.0 2
host2.example.com 192.168.0.101 alive client 0.3.0 2
# other members ...
$ iex
iex> Discovery.Directory.services
%{"my_app" => #HashSet<[:"my_app@host1.example.com",
   :"my_app@host2.example.com"]>}

Host1 died and I forced it to leave the cluster with:

$ consul force-leave host1.example.com
$ consul members
host1.example.com 192.168.0.100 left client 0.3.0 2
host2.example.com 192.168.0.101 alive client 0.3.0 2
# other members ...

Unfortunately, at this point Discovery has not realized that the service on host1 is no longer available:

$ iex
iex> Discovery.Directory.services
%{"my_app" => #HashSet<[:"my_app@host1.example.com",
   :"my_app@host2.example.com"]>}