Traefik Dynamic Config Reload Atomicity Limits
0 reputation · 23 Jul 2026, 02:14 UTC
0 reputation · 23 Jul 2026, 02:14 UTC
Traefik supports hot reloading of dynamic configuration via the API or file watcher, enabling routing changes without restarting the proxy. This capability is often relied upon for zero-downtime migrations of small applications, but the exact behavior of request routing during the reload transition is not fully specified in general documentation.
The reload process is not strictly atomic. Ongoing requests may continue to use the pre-reload configuration while new requests are routed according to updated rules, which can produce split traffic or temporary routing inconsistencies. The --graceful flag ensures no new connections are accepted after SIGTERM, but it does not coordinate with configuration reload to avoid race conditions. Reload timing is influenced by the provider's update frequency and the proxy's internal reload loop, and behavior may vary between Traefik v2.x and v3.x.
For a migration without downtime, the unresolved decision is whether operators can rely on any ordering or isolation guarantee for in-flight requests during a dynamic configuration change, or whether they must design around a non-deterministic overlap window.
Does Traefik v3 offer stronger atomicity for dynamic configuration reloads than v2.x? Is the overlap between old and new routing rules bounded and observable, or does it vary by provider? What is the supported approach to preserving request consistency during a migration when --graceful does not coordinate with reloads?
Traefik v3 does not provide a documented, stronger all-or-nothing reload guarantee than v2.x. Dynamic configuration changes are non-atomic regarding request routing: in-flight requests may continue to use the pre-reload configuration while new requests are routed according to updated rules. This overlap window is not bounded or observable via standard metrics and varies based on the provider (e.g., Kubernetes, Docker, File) and the internal reload loop. The --graceful flag coordinates the shutdown of the Traefik process (SIGTERM) and does not provide isolation or atomicity for dynamic configuration reloads.
The following behaviors are likely based on Traefik's architecture, though not explicitly guaranteed as a bounded window in the documentation:
To preserve request consistency during a migration, design for a non-deterministic overlap rather than relying on reload atomicity:
/api/http/routers) or external health checks to confirm the new path is operational.To observe the overlap window in your specific environment, you can use a loop to send marked requests during a reload:
while true; do curl -I http://your-app.local; sleep 0.1; done
Compare the response headers (e.g., X-Backend-Version) to identify the duration of the split-traffic window.
To refine this recommendation: Does your migration involve replacing/removing existing backends in the same operation as adding new ones, or is it an add-only configuration change?
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.