mirror of
https://github.com/caddyserver/caddy.git
synced 2026-11-12 05:44:39 +00:00
|
Some checks are pending
Tests / test (./cmd/caddy/caddy, ~1.27.0, macos-latest, 0, 1.27, mac) (push) Waiting to run
Tests / test (./cmd/caddy/caddy, ~1.27.0, ubuntu-latest, 0, 1.27, linux) (push) Waiting to run
Tests / test (./cmd/caddy/caddy.exe, ~1.27.0, windows-latest, True, 1.27, windows) (push) Waiting to run
Tests / test (s390x on IBM Z) (push) Waiting to run
Tests / goreleaser-check (push) Waiting to run
Cross-Build / build (~1.26.0, 1.26, aix) (push) Waiting to run
Cross-Build / build (~1.26.0, 1.26, darwin) (push) Waiting to run
Cross-Build / build (~1.26.0, 1.26, dragonfly) (push) Waiting to run
Cross-Build / build (~1.26.0, 1.26, freebsd) (push) Waiting to run
Cross-Build / build (~1.26.0, 1.26, illumos) (push) Waiting to run
Cross-Build / build (~1.26.0, 1.26, linux) (push) Waiting to run
Cross-Build / build (~1.26.0, 1.26, netbsd) (push) Waiting to run
Cross-Build / build (~1.26.0, 1.26, openbsd) (push) Waiting to run
Cross-Build / build (~1.26.0, 1.26, solaris) (push) Waiting to run
Cross-Build / build (~1.26.0, 1.26, windows) (push) Waiting to run
Lint / lint (push) Waiting to run
Lint / lint-1 (push) Waiting to run
Lint / lint-2 (push) Waiting to run
Lint / govulncheck (push) Waiting to run
Lint / dependency-review (push) Waiting to run
OpenSSF Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
* reverseproxy: reduce lock contention in dynamic SRV and A upstreams (#7946) The shared SRV and A/AAAA caches held a global write lock across the DNS lookup, so one slow or timing-out record blocked every unrelated upstream source. Lookups now run without the cache lock held, deduplicated per key with singleflight. A per-key generation (stored on the cache entry, so it is bounded by the cache cap) and a cache-wide epoch keep a lookup that was in flight during ResetSRV/ResetAllSRV from writing its result back, and are part of the singleflight key so callers after a reset do not join a pre-reset lookup. The shared lookup is detached from the request that started it and bounded by its own 30s timeout; each caller still returns as soon as its own context is done. Distinct lookups across both caches are capped by a shared gate (64 running, 256 queued); beyond that they are shed, serving a stale SRV entry if a grace period is set and one is cached. SRV and A now share one cache implementation. AUpstreams also implements CachingUpstreamSource (via new ResetA/ResetAllA), so retries purge its cache entry like SRVUpstreams already did. Rebased onto the move of this code into modules/internal/network (#7790, #8252). Fixes #7946 Co-authored-by: Francis Lavoie <lavofr@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * network: backdate cache entries in TestShedLookups instead of a 1ns refresh On Windows two close time.Now() calls can report no elapsed time, so an entry seeded with a 1ns refresh could still be fresh and skip the shed path entirely. * network: move the shared cache and lookup gate into cache.go dynamicupstreams.go keeps the SRV/A API; the generic cache, its singleflight/generation handling and the lookup gate are not specific to either record type. No functional change. * network: preserve cache reset and grace semantics --------- Co-authored-by: Francis Lavoie <lavofr@gmail.com> Co-authored-by: steadytao <mail@steadytao.com> |
||
|---|---|---|
| .. | ||
| cache.go | ||
| cache_test.go | ||
| dynamicupstreams.go | ||
| dynamicupstreams_test.go | ||
| networkproxy.go | ||
| networkproxy_test.go | ||