Browse Source

reverseproxy: Abort active health checks on context cancellation

master
Matthew Holt 4 years ago
parent
commit
724b74d981
No known key found for this signature in database GPG Key ID: 2A349DD577D586A5
  1. 5
      modules/caddyhttp/reverseproxy/healthchecks.go

5
modules/caddyhttp/reverseproxy/healthchecks.go

@ -216,9 +216,8 @@ func (h *Handler) doActiveHealthCheck(dialInfo DialInfo, hostAddr string, host H
u.Host = net.JoinHostPort(host, portStr)
}
// attach dialing information to this request - TODO: use caddy.Context's context
// so it can be canceled on config reload
ctx := context.Background()
// attach dialing information to this request
ctx := h.ctx.Context
ctx = context.WithValue(ctx, caddy.ReplacerCtxKey, caddy.NewReplacer())
ctx = context.WithValue(ctx, caddyhttp.VarsCtxKey, map[string]interface{}{
dialInfoVarKey: dialInfo,

Loading…
Cancel
Save