1. The problem
In one sentence
The server answers 503 Service Unavailable for a short time (a restart, a deploy, a dependency), and then works again, and the client either fails at once or does not know it may try again.
A story
During a deploy, the first two calls after the restart answer 503. The third and later are fine. A client with no retry reports an error to the user at the first 503. A client that retries a few times, with a short wait, never shows anything: the user does not notice the deploy.
Why it hurts
Brief outages are a normal part of running a system. What decides whether a user sees them is the client’s behaviour: retry, wait and give up.
- For developers: retries must be bounded (a maximum number of attempts, a wait between them), and only for failures that are safe to try again.
- For managers: deploys, scaling and restarts cause short
5xxwindows. A client that handles them turns a planned event into no event at all. - For DevOps: declare
503(withRetry-After) in the spec so that clients expect it, and make the deploy process send it, not a closed connection.
Example
A sandbox route that answers 503 for the first two calls after a reset, and 200 afterwards. The spec declares only 200:
GET /unavailable-then-ok call 1 -> 503
GET /unavailable-then-ok call 2 -> 503
GET /unavailable-then-ok call 3 -> 200
GET /unavailable-then-ok call 4 -> 200
How to detect it without clrsig
curl -s -o /dev/null -w '%{http_code}\n' URLa few times during a deploy.- Look in the client logs for errors that cluster at deploy times and then stop by themselves.
How to fix it
There are two usual causes:
- The client is not resilient (more likely). Add a bounded retry with a wait, for
5xxand network errors only. A4xxis a real answer, and retrying it hides the mistake. - The spec does not describe the outage. Declare
503and theRetry-Afterheader, so the retry is part of the contract.
To tell which: ask whether a user should ever see a deploy. Never retry forever, and never retry a write that is not safe to repeat (AC-042).
Related problems
AC-050 The server fails every few calls, AC-049 The server never answers, AC-051 A rate limit hits unexpectedly.
Words used on this page are explained once in the glossary.
2. How clrsig helps
Check
CS-RESP-001 Undeclared response status: the 503 is not declared, so the first call is reported. State: caught. A scenario step can also retry, which shows how a client that waits sees nothing at all.
Command
Two scenarios, each with one POST (the sandbox reset) and one GET. The first has no retry:
Safety. Run this against a test server, never production.
clrsig conformsendsPOST,PUTandDELETErequests built from the spec: start with--read-only, and take secrets from the environment (${NAME}), never from files in the repository.
schemaVersion: "1"
title: the service is briefly unavailable, no retry
steps:
- label: reset
request: { method: POST, url: "{{baseUrl}}/__admin/reset" }
assertions:
- { type: status, operator: eq, expected: 204 }
failPolicy: stop
- label: first call
request: { method: GET, url: "{{baseUrl}}/unavailable-then-ok" }
assertions:
- { type: status, operator: eq, expected: 200 }
failPolicy: continue
The second adds a retry to the step:
schemaVersion: "1"
title: the service is briefly unavailable, with a retry
steps:
- label: reset
request: { method: POST, url: "{{baseUrl}}/__admin/reset" }
assertions:
- { type: status, operator: eq, expected: 204 }
failPolicy: stop
- label: first call, up to 3 attempts
retry: { maxAttempts: 3, delayMs: 200 }
request: { method: GET, url: "{{baseUrl}}/unavailable-then-ok" }
assertions:
- { type: status, operator: eq, expected: 200 }
failPolicy: continue
maxAttempts is the total number of attempts. A step is re-sent after a network error or a 5xx. A failed assertion, a 4xx or a spec violation never triggers a retry, because those are real results. Save them as outage-no-retry.yaml and outage-retry.yaml, and run each:
clrsig run outage-no-retry.yaml \
--env clrsig/environments/conform-fail.yaml \
--spec specs/conform-fail.yaml
Exit code: 0 all steps pass, 1 a step failed, 2 the scenario or the setup is broken. The first run exits 1, the second 0.
What you see
Output from clrsig v0.21.0, recorded on 2026-11-30. Without a retry:
Scenario: the service is briefly unavailable, no retry
PASS reset 204 14ms
✓ status eq 204
FAIL first call 503 2ms
→ The server answered 503, and its Retry-After header asks to wait 1 second before trying again. Check: Wait at least that long before sending it again. That may still not be enough. A scenario step’s retry settings do not read this header. For a limit on requests, check the API’s rate limits; for a service that is unavailable, check its status or maintenance notices. [CS-HINT-002]
✗ status eq 200: expected "200"; got "503"
✗ schema: GET /unavailable-then-ok answered 503, but the spec declares only 200
Spec: 1 of 2 responses were not compared with the spec (no matching operation in the spec: 1)
FAILED 1 passed, 1 failed, 0 skipped (1/3 assertions passed) 18ms
With a retry of up to 3 attempts:
Output from clrsig v0.21.0, recorded on 2026-11-30:
Scenario: the service is briefly unavailable, with a retry
PASS reset 204 17ms
✓ status eq 204
PASS first call, up to 3 attempts 200 2ms (3 attempts)
✓ status eq 200
Spec: 1 of 2 responses were not compared with the spec (no matching operation in the spec: 1)
PASSED 2 passed, 0 failed, 0 skipped (2/2 assertions passed) 428ms
How to read it: without a retry, the first call fails on the 503. With a retry, the step passes on the third attempt ((3 attempts)), and the run takes about 423 ms because of the two waits of 200 ms.
Where to look
- Desktop app: open the scenario and run it; the step shows the number of attempts.
- Reports:
--format jsonandjunitonclrsig run. - GitHub Action: use
command: runwith thescenario,envandspecinputs;specreplaces the scenario’sspecFile. Older releases of the Action ignoredspecwithrun; if you use one, addspecFile: specs/conform-fail.yamlto the scenario instead (the path is relative to the scenario file) (setup and upgrading).
How clrsig helps you fix it
The pair of runs shows the difference a bounded retry makes, and that the 503 is not in the spec. It does not decide the right number of attempts for your clients.
Limits
- A retry hides the outage from the test too. Use it to model a client, and keep a version without it to see the outage.
- Never retry a write that is not safe to repeat.
More ways
Nothing yet.
3. Video brief for Google NotebookLM
VIDEO BRIEF — AC-052 · The server is down for a while and then recovers
Length: 5 to 7 minutes. Language: English. Audience: developers, with a line each for managers and DevOps.
One idea: brief outages are normal; whether the user sees them depends on the client's bounded retry.
Open with this story: During a deploy, the first two calls after the restart answer 503. The third and later are fine. A client with no retry reports an error to the user at the first 503. A client that retries a few times, with a short wait, never shows anything: the user does not notice the deploy.
Say these facts, in this order:
1. The sandbox route answers 503 for the first two calls after a reset and then 200. The spec declares only 200.
2. Without a retry, the scenario step fails on the 503, and the schema line says 503 is not declared.
3. With a retry of up to 3 attempts and a wait of 200 milliseconds, the same step passes, and the output says 3 attempts.
4. A step is re-sent after a network error or a 5xx; a failed assertion, a 4xx or a spec violation never triggers a retry, because those are real results.
5. Two usual causes: the client is not resilient (add a bounded retry for 5xx and network errors only), or the spec does not describe the outage (declare 503 and Retry-After).
6. Never retry forever, and never retry a write that is not safe to repeat.
7. For managers: deploys and restarts cause short 5xx windows; a resilient client turns a planned event into no event.
8. For DevOps: make the deploy process send 503, not a closed connection.
Show on screen: the four-call list, the two scenario YAML files, and the two output blocks, copied exactly from the card.
Name the check: CS-RESP-001, Undeclared response status. Say the clrsig version: v0.21.0.
Explain these words once: 503 (service unavailable); retry (sending the same request again); bounded (with a maximum number of attempts); exit code (0 clean, 1 a finding, 2 setup or spec broken).
Say what clrsig does not see here: a retry hides the outage from the test too; it does not decide the right number of attempts for your clients.
Safety line (if a write is shown): Run this against a test server, never production. clrsig conform sends POST, PUT and DELETE requests built from the spec: start with --read-only, and take secrets from the environment (${NAME}), never from files in the repository.
Finish with three recap questions:
1. Which failures does a step retry? (Network errors and 5xx answers.)
2. Why is a 4xx not retried? (It is a real answer; retrying would hide the mistake.)
3. What must you never retry blindly? (A write that is not safe to repeat.)
Tease the next video: AC-053 · The server gets slower with every call.
Do not: say "contract testing" alone; say clrsig "catches everything"; invent flags, IDs or numbers; read tables aloud; use any fact that is not in the card.