0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00
caddy/caddyhttp
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
..
basicauth Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
bind Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
browse Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
errors Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
expvar Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
extensions Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
fastcgi Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
gzip Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
header Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
httpserver Ensure certificate has a non-nil config when caching (fixes #875) 2016-06-09 19:12:11 -06:00
internalsrv Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
log Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
markdown Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
mime Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
pprof Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
proxy Balance round robin evenly when some hosts are down (#880) 2016-06-14 15:43:06 -06:00
redirect Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
rewrite Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
root Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
staticfiles Rewrote Caddy from the ground up; initial commit of 0.9 branch 2016-06-04 17:00:29 -06:00
templates Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
websocket Make RegisterPlugin() more consistent, having name as first argument 2016-06-06 15:31:03 -06:00
caddyhttp.go Migrate remaining middleware packages 2016-06-05 22:39:23 -06:00