You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Apply a route switch in one Caddy configuration load #438
caddy.Client.ApplyRoute changes Caddy's configuration twice for one route change: the route itself (PATCH /id/<route> or POST …/routes), then the plain-HTTP hosts (SetPlainHosts). Caddy applies each change as a full reload. At each reload, its previous HTTP server:
finishes the requests in flight;
closes the idle keep-alive connections at once.
A client that sends a request on one of them at that instant gets a reset, as #437 found. Caddy's log of the failed run shows the two loads 1 ms apart.
Proposal
Apply a switch as one change, in one admin request. For example, replace the server's routes and automatic_https.skip together, or the whole HTTP app configuration under an If-Match precondition. This halves the moments at which idle connections are closed. It also removes the window between the two writes, in which the route and the plain hosts disagree.
Acceptance
One configuration load per UpsertRoute and per RemoveRoute, checked in the real Caddy test by counting the autosaved config lines, or through the admin API.
The existing guarantees hold: a failed write leaves every host reachable, and the order is kept.
Activity
test(agent): the real switch test creates Caddy's server before it co…
test(agent): the real switch test counts from after the server's own …