caddy/modules/caddyhttp/reverseproxy
Paulo Henrique 88616e86e6
api: Add all in-flight requests /reverse_proxy/upstreams (Fixes #7277) (#7517)
This refactors the initial approach in PR #7281, replacing the UsagePool
with a dedicated package-level sync.Map and atomic.Int64 to track
in-flight requests without global lock contention.

It also introduces a lookup map in the admin API to fix a potential
O(n^2) iteration over upstreams, ensuring that draining upstreams
are correctly exposed across config reloads without leaking memory.

Co-authored-by: Y.Horie <u5.horie@gmail.com>

reverseproxy: optimize in-flight tracking and admin API

- Replaced sync.RWMutex with sync.Map and atomic.Int64 to avoid lock contention under high RPS.
- Introduced a lookup map in the admin API to fix a potential O(n^2) iteration over upstreams.
2026-03-03 15:14:55 -07:00
..
fastcgi chore: Enable modernize linter (#7519) 2026-02-26 14:01:35 -07:00
forwardauth chore: fix some comments (#7303) 2025-10-15 03:58:53 +00:00
addresses.go
addresses_test.go
admin.go api: Add all in-flight requests /reverse_proxy/upstreams (Fixes #7277) (#7517) 2026-03-03 15:14:55 -07:00
ascii.go
ascii_test.go
buffering_test.go
caddyfile.go reverseproxy: Customizable dial network for SRV upstreams 2026-02-02 11:25:51 -07:00
command.go cmd: prevent commas in header values from being split (#7268) 2025-09-22 21:12:06 -06:00
copyresponse.go
headers_test.go reverseproxy: fix X-Forwarded-* headers for Unix socket requests (#7463) 2026-02-10 13:00:20 -07:00
healthchecks.go reverseproxy: Fix `health_port` being ignored in health checks (#7533) 2026-03-03 13:10:54 -05:00
hosts.go reverseproxy: do not disable keepalive if proxy protocol is used (#7300) 2025-10-21 05:09:37 +00:00
httptransport.go caddyhttp: Avoid nil pointer dereference in proxyWrapper (#7521) 2026-02-25 04:08:41 -05:00
httptransport_test.go reverseproxy: fix tls dialing w/ proxy protocol (#7508) 2026-02-21 21:37:10 -05:00
metrics.go
reverseproxy.go api: Add all in-flight requests /reverse_proxy/upstreams (Fixes #7277) (#7517) 2026-03-03 15:14:55 -07:00
selectionpolicies.go chore: Enable modernize linter (#7519) 2026-02-26 14:01:35 -07:00
selectionpolicies_test.go
streaming.go chore: Enable modernize linter (#7519) 2026-02-26 14:01:35 -07:00
streaming_test.go
upstreams.go use math/rand/v2 instead of math/rand (#7413) 2026-02-11 09:15:51 -07:00
upstreams_test.go chore: upgrade .golangci.yml and workflow to v2 (#6924) 2025-06-03 02:24:32 +03:00