Configure Retry on Error
⚙️ Advanced
·
Updated 1 month ago
Setup
Via the UI
The toggle sits in the route wizard in Step 5 — Reliability (together with Circuit Breaker and Request Mirroring).
- Create or edit a route
- In Step 5 enable the Retry on Error toggle
- Set Retry Count (1-10, default: 3)
- Save
Via the API
# Enable retry with 5 attempts
curl -X PUT https://gatecontrol.example.com/api/v1/routes/1 \
-H "Authorization: Bearer gc_..." \
-H "Content-Type: application/json" \
-d '{
"retry_enabled": true,
"retry_count": 5
}'
Important notes
- POST/PUT/DELETE are retried as well. GateControl performs no automatic idempotency check — the admin must know whether the backend supports retryable write operations. Example: a retry on
POST /api/orderscould trigger a duplicate order. Only enable retry if the backend supports idempotent operations or only handles GET requests. - Retry is only available for HTTP routes, not for L4 (TCP/UDP).
- Retries happen back-to-back — there is no exponential backoff.
- With a single backend, retries can additionally load the server if it is already overloaded.
- Retry Count of 1 means: 1 initial attempt + 1 retry = maximum 2 requests to the backend.
- Retries are invisible to the client — they either receive the successful response or the last error.
- In combination with Circuit Breaker: when the Circuit Breaker is open, no retries are attempted (Caddy immediately serves 503).
See also
- CIRCUIT-BREAKER.md — protects the backend during a permanent outage
- UPTIME-MONITORING.md — detects longer outages complementary to retry