micro/registry
Jelmer Snoeck e59f7a7ace
ConsulRegistry: use health checks to select nodes.
Consul sees a healthcheck that is in the warning state as a "failed"
node. This means that when we ask Consul for services that are passing,
it would not return nodes that have warning healthchecks.

In the cache, we only check on critical to skip for nodes. This makes
the cache out of sync with the non-cache implementation.

This patch reworks the non-cache implementation to ask for all nodes
(even unhealthy ones) and does the same check as within the cache, skip
nodes that have critical healthchecks.

We've noticed this issue when we deployed custom healthchecks where the
cache was acting properly, but after 1 minute we saw "None Available"
errors. This is due to the TTL expiry on the cache, which is then
followed by doing a non cached request.
2016-08-26 08:36:45 +01:00
..
consul Don't add to defaults in func init, just add them to cmd 2016-04-26 18:49:02 +01:00
mdns Simplify watcher test 2016-05-01 22:30:33 +01:00
mock return error when zero services in mock registry 2016-06-30 20:11:04 +01:00
consul_registry_test.go ConsulRegistry: use health checks to select nodes. 2016-08-26 08:36:45 +01:00
consul_registry.go ConsulRegistry: use health checks to select nodes. 2016-08-26 08:36:45 +01:00
consul_watcher_test.go ConsulWatcher: deregister if service checks fail. 2016-08-11 15:18:50 +01:00
consul_watcher.go make a copy of services for handle method 2016-08-24 18:37:11 +01:00
doc.go Add package comments 2016-05-24 22:22:46 +01:00
encoding_test.go No longer need to test old encoding 2016-05-22 18:41:06 +01:00
encoding.go Don't strip decode because its good to be backwards compatible still 2016-05-22 18:43:47 +01:00
options.go Registry init 2016-03-15 22:20:21 +00:00
registry.go Registry init 2016-03-15 22:20:21 +00:00
service.go add json tags to registry service 2015-12-15 21:02:43 +00:00
watcher.go Add watcher comments 2015-12-05 02:05:06 +00:00