FAILURE MAP
← Case archive

FA-6656 / HTTP retries / Open access

Negative Retry-After delays are clamped before imposing a cap · case 01

Negative Retry-After delays are clamped before imposing a cap.

Verified by executionVariant 1 · 4 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The faulty implementation uses `min(cap, delay)` for the retry-after-delay decision.

VERIFIED REPAIR

Apply the explicit retry-after-delay contract, including the tested boundary and negative cases.

Unsuccessful approach: The attempted repair uses `max(cap, max(0, delay))` and still violates a separate fixture.

Case contract

Negative Retry-After delays are clamped before imposing a cap: return the result specified by the explicit input/output boundary fixtures.

Why this case matters

This deterministic http retries model isolates the retry-after-delay policy at a network component boundary.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(delay, cap):
    return min(cap, delay)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(-1, 10), 0)", "check('fixture 2', solve(3, 10), 3)", "check('fixture 3', solve(20, 10), 10)", "check('fixture 4', solve(0, 0), 0)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 233Passed
fixture 31010Passed
fixture 400Passed
fixture 1-10Failed

SHA-256 / 8a30b3782be156c4edfb4eca2a5878ec4df0a20352a26c02f46ded38c88fbe9c

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(delay, cap):
    return max(cap, max(0, delay))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(-1, 10), 0)", "check('fixture 2', solve(3, 10), 3)", "check('fixture 3', solve(20, 10), 10)", "check('fixture 4', solve(0, 0), 0)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 2103Failed
fixture 32010Failed
fixture 400Passed
fixture 1100Failed

SHA-256 / 095af1e918580ad09153ddb8cc6e77f829229574dc7d19000b3fe0e2111ab8a4

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(delay, cap):
    return min(cap, max(0, delay))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(-1, 10), 0)", "check('fixture 2', solve(3, 10), 3)", "check('fixture 3', solve(20, 10), 10)", "check('fixture 4', solve(0, 0), 0)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 233Passed
fixture 31010Passed
fixture 400Passed
fixture 100Passed

SHA-256 / 550a7268ef93d8628eb659e3787e858b8e8c66f7cf09f018ec9d1720c8b1a8c4

Verification & scope

Bounded deterministic policy model over validated inputs; not a complete protocol stack or an interoperability claim. The five variants rotate the same explicit fixture set. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:38:04.027260+00:00.

Case digest / 9511f29593296cef32f8fbc590f99d6acd82170b3b6464184e94a97a7a89c5a8