FAILURE MAP
← Case archive

FA-30361 / HTTP retries / Open access

Challenge refresh without ordinary retry amplification: Refresh single delivery violates retry transition semantics · case 01

Refresh single delivery violates retry transition semantics

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

ROOT CAUSE

Refresh single delivery violates retry transition semantics

VERIFIED REPAIR

Restore the specified transition terminal or not waiting or.

Unsuccessful approach: The attempted repair changes the faulty site to terminal and not waiting or but still violates a regression oracle.

Case contract

begin(ordinary retries,refresh allowance) starts a request. network_failure spends ordinary allowance, challenge spends refresh allowance only if no refresh in flight, refreshed(generation) completes only current refresh generation and records auth replay. While refreshing network failures wait. success terminates both budgets; late refresh is ignored. No credentials are represented.

Why this case matters

Offline deterministic model of HTTP request retries.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    ordinary=0; refresh=0; generation=0; waiting=False; terminal=True; out=[]
    for e in events:
        if e[0]=='begin': ordinary=e[1]; refresh=e[2]; generation=0; waiting=False; terminal=False
        elif e[0]=='success': terminal=True; waiting=False
        elif e[0]=='network':
            if terminal: out.append('terminal'); continue
            if waiting: out.append('waiting'); continue
            if ordinary==0: out.append('exhausted'); continue
            ordinary-=1; out.append('retry')
        elif e[0]=='challenge':
            if terminal: out.append('terminal'); continue
            if waiting: out.append('coalesced'); continue
            if refresh==0: out.append('auth-exhausted'); continue
            refresh-=1; generation+=1; waiting=True
            out.append(['refresh',generation])
        elif e[0]=='refreshed':
            if terminal or e[1]!=generation: out.append('stale'); continue
            waiting=False; out.append('auth-replay')
    return [out,ordinary,refresh]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [[],0,0])
check('1', solve([('begin',2,1),('network',),('challenge',),('network',),('challenge',),('refreshed',1),('refreshed',1),('network',),('network',),('challenge',)]), [['retry',['refresh',1],'waiting','coalesced','auth-replay','stale','retry','exhausted','auth-exhausted'],0,0])
check('2', solve([('begin',0,2),('challenge',),('refreshed',1),('challenge',),('refreshed',1),('refreshed',3),('refreshed',2)]), [[['refresh',1],'auth-replay',['refresh',2],'stale','stale','auth-replay'],0,0])
check('3', solve([('begin',N,1),('challenge',),('success',),('refreshed',1),('network',),('challenge',)]), [[['refresh',1],'stale','terminal','terminal'],N,0])
check('4', solve([('begin',0,0),('network',),('challenge',)]), [['exhausted','auth-exhausted'],0,0])
check('5', solve([('begin',1,1),('challenge',),('begin',0,1),('challenge',),('refreshed',1)]), [[['refresh',1],['refresh',1],'auth-replay'],0,0])
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
0[[], 0, 0][[], 0, 0]Passed
1[['retry', ['refresh', 1], 'waiting', 'coalesced', 'auth-replay', 'auth-replay', 'retry', 'exhausted', 'auth-exhausted'], 0, 0][['retry', ['refresh', 1], 'waiting', 'coalesced', 'auth-replay', 'stale', 'retry', 'exhausted', 'auth-exhausted'], 0, 0]Failed
2[[['refresh', 1], 'auth-replay', ['refresh', 2], 'stale', 'stale', 'auth-replay'], 0, 0][[['refresh', 1], 'auth-replay', ['refresh', 2], 'stale', 'stale', 'auth-replay'], 0, 0]Passed
3[[['refresh', 1], 'stale', 'terminal', 'terminal'], 1, 0][[['refresh', 1], 'stale', 'terminal', 'terminal'], 1, 0]Passed
4[['exhausted', 'auth-exhausted'], 0, 0][['exhausted', 'auth-exhausted'], 0, 0]Passed
5[[['refresh', 1], ['refresh', 1], 'auth-replay'], 0, 0][[['refresh', 1], ['refresh', 1], 'auth-replay'], 0, 0]Passed

SHA-256 / ba8c9d1a8a665a4a246b33652b6ec3b2fc99b9b2fe3f312f0ca81f2290113e3d

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    ordinary=0; refresh=0; generation=0; waiting=False; terminal=True; out=[]
    for e in events:
        if e[0]=='begin': ordinary=e[1]; refresh=e[2]; generation=0; waiting=False; terminal=False
        elif e[0]=='success': terminal=True; waiting=False
        elif e[0]=='network':
            if terminal: out.append('terminal'); continue
            if waiting: out.append('waiting'); continue
            if ordinary==0: out.append('exhausted'); continue
            ordinary-=1; out.append('retry')
        elif e[0]=='challenge':
            if terminal: out.append('terminal'); continue
            if waiting: out.append('coalesced'); continue
            if refresh==0: out.append('auth-exhausted'); continue
            refresh-=1; generation+=1; waiting=True
            out.append(['refresh',generation])
        elif e[0]=='refreshed':
            if terminal and not waiting or e[1]!=generation: out.append('stale'); continue
            waiting=False; out.append('auth-replay')
    return [out,ordinary,refresh]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [[],0,0])
check('1', solve([('begin',2,1),('network',),('challenge',),('network',),('challenge',),('refreshed',1),('refreshed',1),('network',),('network',),('challenge',)]), [['retry',['refresh',1],'waiting','coalesced','auth-replay','stale','retry','exhausted','auth-exhausted'],0,0])
check('2', solve([('begin',0,2),('challenge',),('refreshed',1),('challenge',),('refreshed',1),('refreshed',3),('refreshed',2)]), [[['refresh',1],'auth-replay',['refresh',2],'stale','stale','auth-replay'],0,0])
check('3', solve([('begin',N,1),('challenge',),('success',),('refreshed',1),('network',),('challenge',)]), [[['refresh',1],'stale','terminal','terminal'],N,0])
check('4', solve([('begin',0,0),('network',),('challenge',)]), [['exhausted','auth-exhausted'],0,0])
check('5', solve([('begin',1,1),('challenge',),('begin',0,1),('challenge',),('refreshed',1)]), [[['refresh',1],['refresh',1],'auth-replay'],0,0])
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
0[[], 0, 0][[], 0, 0]Passed
1[['retry', ['refresh', 1], 'waiting', 'coalesced', 'auth-replay', 'auth-replay', 'retry', 'exhausted', 'auth-exhausted'], 0, 0][['retry', ['refresh', 1], 'waiting', 'coalesced', 'auth-replay', 'stale', 'retry', 'exhausted', 'auth-exhausted'], 0, 0]Failed
2[[['refresh', 1], 'auth-replay', ['refresh', 2], 'stale', 'stale', 'auth-replay'], 0, 0][[['refresh', 1], 'auth-replay', ['refresh', 2], 'stale', 'stale', 'auth-replay'], 0, 0]Passed
3[[['refresh', 1], 'stale', 'terminal', 'terminal'], 1, 0][[['refresh', 1], 'stale', 'terminal', 'terminal'], 1, 0]Passed
4[['exhausted', 'auth-exhausted'], 0, 0][['exhausted', 'auth-exhausted'], 0, 0]Passed
5[[['refresh', 1], ['refresh', 1], 'auth-replay'], 0, 0][[['refresh', 1], ['refresh', 1], 'auth-replay'], 0, 0]Passed

SHA-256 / 09405f229aca19698dc11cdb9a5e98881c3321e1c0948402e21a0631840e1817

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    ordinary=0; refresh=0; generation=0; waiting=False; terminal=True; out=[]
    for e in events:
        if e[0]=='begin': ordinary=e[1]; refresh=e[2]; generation=0; waiting=False; terminal=False
        elif e[0]=='success': terminal=True; waiting=False
        elif e[0]=='network':
            if terminal: out.append('terminal'); continue
            if waiting: out.append('waiting'); continue
            if ordinary==0: out.append('exhausted'); continue
            ordinary-=1; out.append('retry')
        elif e[0]=='challenge':
            if terminal: out.append('terminal'); continue
            if waiting: out.append('coalesced'); continue
            if refresh==0: out.append('auth-exhausted'); continue
            refresh-=1; generation+=1; waiting=True
            out.append(['refresh',generation])
        elif e[0]=='refreshed':
            if terminal or not waiting or e[1]!=generation: out.append('stale'); continue
            waiting=False; out.append('auth-replay')
    return [out,ordinary,refresh]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [[],0,0])
check('1', solve([('begin',2,1),('network',),('challenge',),('network',),('challenge',),('refreshed',1),('refreshed',1),('network',),('network',),('challenge',)]), [['retry',['refresh',1],'waiting','coalesced','auth-replay','stale','retry','exhausted','auth-exhausted'],0,0])
check('2', solve([('begin',0,2),('challenge',),('refreshed',1),('challenge',),('refreshed',1),('refreshed',3),('refreshed',2)]), [[['refresh',1],'auth-replay',['refresh',2],'stale','stale','auth-replay'],0,0])
check('3', solve([('begin',N,1),('challenge',),('success',),('refreshed',1),('network',),('challenge',)]), [[['refresh',1],'stale','terminal','terminal'],N,0])
check('4', solve([('begin',0,0),('network',),('challenge',)]), [['exhausted','auth-exhausted'],0,0])
check('5', solve([('begin',1,1),('challenge',),('begin',0,1),('challenge',),('refreshed',1)]), [[['refresh',1],['refresh',1],'auth-replay'],0,0])
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
0[[], 0, 0][[], 0, 0]Passed
1[['retry', ['refresh', 1], 'waiting', 'coalesced', 'auth-replay', 'stale', 'retry', 'exhausted', 'auth-exhausted'], 0, 0][['retry', ['refresh', 1], 'waiting', 'coalesced', 'auth-replay', 'stale', 'retry', 'exhausted', 'auth-exhausted'], 0, 0]Passed
2[[['refresh', 1], 'auth-replay', ['refresh', 2], 'stale', 'stale', 'auth-replay'], 0, 0][[['refresh', 1], 'auth-replay', ['refresh', 2], 'stale', 'stale', 'auth-replay'], 0, 0]Passed
3[[['refresh', 1], 'stale', 'terminal', 'terminal'], 1, 0][[['refresh', 1], 'stale', 'terminal', 'terminal'], 1, 0]Passed
4[['exhausted', 'auth-exhausted'], 0, 0][['exhausted', 'auth-exhausted'], 0, 0]Passed
5[[['refresh', 1], ['refresh', 1], 'auth-replay'], 0, 0][[['refresh', 1], ['refresh', 1], 'auth-replay'], 0, 0]Passed

SHA-256 / b87099113fa62cf1f0df2f2eccee925c37cc270f12a1a06f4ab8cfeba69b34d9

Verification & scope

Stipulated bounded simulator, not a complete HTTP implementation or a standards conformance claim. 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:41:52.220047+00:00.

Case digest / a7f476b6448b9f4d52d502f508693fa4d0bf0dcdff235e3059f575b7aae2166d