0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00
caddy/caddyhttp/proxy
Andrew Hamon fee4890e94 Balance round robin evenly when some hosts are down (#880)
* Balance round robin evenly when some hosts are down

Before, when load balancing across multiple hosts, if a host went down
then the next host in line would be sent a double share of requests.
This is because the round robin counter was only incremented once per
request, regardless of the health of the selection. If current
selection was unhealthy then the policy would advance to the next host,
but this would not be reflected in the policy counter. To fix this, the
counter is now incremented for every attempted host.

This commit adds a test case that identifies the issue, and a fix.

* Make robin counter private

* Use a mutex to sync round robin selection
2016-06-14 15:43:06 -06:00
..
policy.go Balance round robin evenly when some hosts are down (#880) 2016-06-14 15:43:06 -06:00
policy_test.go Balance round robin evenly when some hosts are down (#880) 2016-06-14 15:43:06 -06:00
proxy.go Migrating more middleware packages 2016-06-05 21:51:56 -06:00
proxy_test.go Migrating more middleware packages 2016-06-05 21:51:56 -06:00
reverseproxy.go Migrating more middleware packages 2016-06-05 21:51:56 -06:00
setup.go Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
setup_test.go Migrating more middleware packages 2016-06-05 21:51:56 -06:00
upstream.go Add proxy preset: transparent (#881) 2016-06-14 12:03:30 -06:00
upstream_test.go Add proxy preset: transparent (#881) 2016-06-14 12:03:30 -06:00