0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00
caddy/caddyhttp/proxy
Augusto Roman 463c9d9dd2 Fix data race for max connection limiting in proxy directive. (#1438)
* Fix data race for max connection limiting in proxy directive.

The Conns and Unhealthy fields are updated concurrently across all active
requests.  Because of this, they must use atomic operations for reads and
writes.

Prior to this change, Conns was incremented atomically, but read unsafely.
Unhealthly was updated & read unsafely.  The new test
TestReverseProxyMaxConnLimit exposes this race when run with -race.

Switching to atomic operations makes the race detector happy.

* oops, remove leftover dead code.
2017-02-15 08:09:42 -07:00
..
body.go proxy: record request Body for retry (fixes #1229) 2016-11-04 19:15:36 +08:00
body_test.go proxy: record request Body for retry (fixes #1229) 2016-11-04 19:15:36 +08:00
policy.go 1136 fix 2016-09-28 04:09:46 -07:00
policy_test.go Fix data race for max connection limiting in proxy directive. (#1438) 2017-02-15 08:09:42 -07:00
proxy.go Fix data race for max connection limiting in proxy directive. (#1438) 2017-02-15 08:09:42 -07:00
proxy_test.go Fix data race for max connection limiting in proxy directive. (#1438) 2017-02-15 08:09:42 -07:00
reverseproxy.go proxy: use a new context for the outgoing request (#1358) 2017-01-23 18:03:42 -07:00
setup.go Refactor how caddy.Context is stored and used 2016-06-20 11:59:23 -06:00
setup_test.go proxy: make value is optional when removing a header 2016-11-03 22:50:51 +00:00
upstream.go Fix data race for max connection limiting in proxy directive. (#1438) 2017-02-15 08:09:42 -07:00
upstream_test.go Fix data race for max connection limiting in proxy directive. (#1438) 2017-02-15 08:09:42 -07:00