Closed starkj closed 10 years ago
I have not problem switching to this behavior if I can guarantee that the 'die' event fires for 'stop' as well as other events on a container. I will walk the Docker code base to see if I can better understand when this event will fire.
If we can't guarantee this, we can look into queueing/resolving service removal events so we could request a service to be removed for both a 'stop', 'die' and any other appropriate event, but only make a DELETE call to Etcd once.
This has been resolved in Release 0.4.0.
I confirmed in the docker source that the docker container will emit a 'die' event every time it stops running, making that event be a better target for removing service registries.
cool, thx for investigating this
It seems to me that docker emits a die-event (in addition) every time a container stops, gets killed or dies on its own. Unfortunately I haven't found any documentation on this behavior.
I think it would be better to unregister services in any case a container isn't available any more. So I suggest to check for "die" instead of "stop" here: https://github.com/totem/discover/blob/develop/lib/discover.js#L161
What do you think?