FAILURE MAP
← Case archive

FA-29641 / HTTP retries / Open access

Retry only unresolved batch members: An unsolicited result injects an item into the next retry batch · case 01

An unsolicited result injects an item into the next retry batch

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

ROOT CAUSE

An unsolicited result injects an item into the next retry batch

VERIFIED REPAIR

Restore the specified transition if k not in state: continue.

Unsuccessful approach: The attempted repair changes the faulty site to if k not in state: state[k]=['pending',None]; order.insert(0,k) but still violates a regression oracle.

Case contract

open(list of item IDs) establishes ordered batch. result(id,status,value) records first success, retryable failure, or permanent failure; unknown IDs ignored. retry returns unresolved/retryable items in original order including duplicates. done returns values or null in original positions. Success/permanent terminal entries cannot be overwritten by late responses.

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):
    order=[]; state={}; out=[]
    for e in events:
        if e[0]=='open':
            order=list(e[1]); state={k:['pending',None] for k in order}
        elif e[0]=='result':
            k,status,value=e[1:]
            if k not in state: state[k]=['pending',None]; order.append(k)
            if state[k][0] in ('success','permanent'): continue
            if status=='success': state[k]=['success',value]
            elif status=='permanent': state[k]=['permanent',None]
            else: state[k]=['retry',None]
        elif e[0]=='retry':
            out.append([k for k in order if state[k][0] in ('pending','retry')])
        elif e[0]=='done':
            out.append([state[k][1] if state[k][0]=='success' else None for k in order])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [])
check('1', solve([('open',['b','a','b']),('retry',),('result','b','success',N),('done',),('retry',)]), [['b','a','b'],[N,None,N],['a']])
check('2', solve([('open',['a','b']),('result','a','retry',N),('result','b','permanent',N),('retry',),('done',)]), [['a'],[None,None]])
check('3', solve([('open',['a']),('result','z','success',N),('retry',),('done',)]), [['a'],[None]])
check('4', solve([('open',['a','b']),('result','a','success',N),('result','a','retry',0),('result','b','permanent',0),('result','b','retry',0),('retry',),('done',)]), [[],[N,None]])
check('5', solve([('open',['a']),('result','a','success',N),('open',['a']),('retry',),('done',)]), [['a'],[None]])
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[][]Passed
1[['b', 'a', 'b'], [1, None, 1], ['a']][['b', 'a', 'b'], [1, None, 1], ['a']]Passed
2[['a'], [None, None]][['a'], [None, None]]Passed
3[['a'], [None, 1]][['a'], [None]]Failed
4[[], [1, None]][[], [1, None]]Passed
5[['a'], [None]][['a'], [None]]Passed

SHA-256 / 761ea51c472170fbb21878777690e5896eebc77f7d7b74b699a6d24621990d54

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(events):
    order=[]; state={}; out=[]
    for e in events:
        if e[0]=='open':
            order=list(e[1]); state={k:['pending',None] for k in order}
        elif e[0]=='result':
            k,status,value=e[1:]
            if k not in state: state[k]=['pending',None]; order.insert(0,k)
            if state[k][0] in ('success','permanent'): continue
            if status=='success': state[k]=['success',value]
            elif status=='permanent': state[k]=['permanent',None]
            else: state[k]=['retry',None]
        elif e[0]=='retry':
            out.append([k for k in order if state[k][0] in ('pending','retry')])
        elif e[0]=='done':
            out.append([state[k][1] if state[k][0]=='success' else None for k in order])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [])
check('1', solve([('open',['b','a','b']),('retry',),('result','b','success',N),('done',),('retry',)]), [['b','a','b'],[N,None,N],['a']])
check('2', solve([('open',['a','b']),('result','a','retry',N),('result','b','permanent',N),('retry',),('done',)]), [['a'],[None,None]])
check('3', solve([('open',['a']),('result','z','success',N),('retry',),('done',)]), [['a'],[None]])
check('4', solve([('open',['a','b']),('result','a','success',N),('result','a','retry',0),('result','b','permanent',0),('result','b','retry',0),('retry',),('done',)]), [[],[N,None]])
check('5', solve([('open',['a']),('result','a','success',N),('open',['a']),('retry',),('done',)]), [['a'],[None]])
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[][]Passed
1[['b', 'a', 'b'], [1, None, 1], ['a']][['b', 'a', 'b'], [1, None, 1], ['a']]Passed
2[['a'], [None, None]][['a'], [None, None]]Passed
3[['a'], [1, None]][['a'], [None]]Failed
4[[], [1, None]][[], [1, None]]Passed
5[['a'], [None]][['a'], [None]]Passed

SHA-256 / 68aaf8aaa833167cd3d0d7782c35c7c9393cf233eb25432a6e933eabf06a3578

3 / The verified repair

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

N = 1
observations = []
def solve(events):
    order=[]; state={}; out=[]
    for e in events:
        if e[0]=='open':
            order=list(e[1]); state={k:['pending',None] for k in order}
        elif e[0]=='result':
            k,status,value=e[1:]
            if k not in state: continue
            if state[k][0] in ('success','permanent'): continue
            if status=='success': state[k]=['success',value]
            elif status=='permanent': state[k]=['permanent',None]
            else: state[k]=['retry',None]
        elif e[0]=='retry':
            out.append([k for k in order if state[k][0] in ('pending','retry')])
        elif e[0]=='done':
            out.append([state[k][1] if state[k][0]=='success' else None for k in order])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [])
check('1', solve([('open',['b','a','b']),('retry',),('result','b','success',N),('done',),('retry',)]), [['b','a','b'],[N,None,N],['a']])
check('2', solve([('open',['a','b']),('result','a','retry',N),('result','b','permanent',N),('retry',),('done',)]), [['a'],[None,None]])
check('3', solve([('open',['a']),('result','z','success',N),('retry',),('done',)]), [['a'],[None]])
check('4', solve([('open',['a','b']),('result','a','success',N),('result','a','retry',0),('result','b','permanent',0),('result','b','retry',0),('retry',),('done',)]), [[],[N,None]])
check('5', solve([('open',['a']),('result','a','success',N),('open',['a']),('retry',),('done',)]), [['a'],[None]])
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[][]Passed
1[['b', 'a', 'b'], [1, None, 1], ['a']][['b', 'a', 'b'], [1, None, 1], ['a']]Passed
2[['a'], [None, None]][['a'], [None, None]]Passed
3[['a'], [None]][['a'], [None]]Passed
4[[], [1, None]][[], [1, None]]Passed
5[['a'], [None]][['a'], [None]]Passed

SHA-256 / b8a1435b2101cfd498dd8d0e1223e1a11ed44f7cc94d880177a1e3743b2ec5ea

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:45.112925+00:00.

Case digest / b6ec36c4db91b24fa896669c78efad5f27cce86d86fd4fa401f78079f0271ba0