FAILURE MAP
← Case archive

FA-29476 / HTTP retries / Open access

Fresh body factories on retries: Empty retry bodies are incorrectly marked inactive · case 01

Empty retry bodies are incorrectly marked inactive

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

ROOT CAUSE

Empty retry bodies are incorrectly marked inactive

VERIFIED REPAIR

Restore the specified transition active=True out.append.

Unsuccessful approach: The attempted repair changes the faulty site to active=len(body)>0 out.append but still violates a regression oracle.

Case contract

open sets a body factory recipe; attempt calls it to make a fresh cursor, read consumes the current body, change changes the recipe for future logical requests only, new snapshots the changed recipe. Return emitted chunks; attempts beyond allowance return exhausted. Recipe is snapshotted on open/new.

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):
    recipe=[]; snapshot=(); body=[]; cursor=0; calls=0; limit=0; out=[]; active=False
    for e in events:
        if e[0] in ('open','new'):
            recipe=list(e[1]); limit=e[2]
            snapshot=tuple(recipe)
            calls=0
            active=False
        elif e[0]=='change': recipe[:]=e[1]
        elif e[0]=='attempt':
            if calls>=limit:
                out.append('exhausted'); active=False; continue
            body=list(snapshot)
            cursor=0
            calls+=1
            active=False
            out.append('factory')
        elif e[0]=='read':
            if not active: out.append('inactive'); continue
            chunk=body[cursor:cursor+e[1]]
            cursor+=len(chunk)
            out.append(chunk)
    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',[N,N+1,N+2],2),('attempt',),('read',2),('read',1),('read',1),('attempt',),('read',3),('attempt',)]), ['factory',[N,N+1],[N+2],[],'factory',[N,N+1,N+2],'exhausted'])
check('2', solve([('open',[N,N+1],1),('change',[9]),('attempt',),('read',2)]), ['factory',[N,N+1]])
check('3', solve([('open',[],1),('attempt',),('read',1)]), ['factory',[]])
check('4', solve([('open',[N],0),('attempt',),('read',1)]), ['exhausted','inactive'])
check('5', solve([('open',[N],1),('attempt',),('new',[N+1],1),('read',1),('attempt',),('read',1)]), ['factory','inactive','factory',[N+1]])
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['factory', 'inactive', 'inactive', 'inactive', 'factory', 'inactive', 'exhausted']['factory', [1, 2], [3], [], 'factory', [1, 2, 3], 'exhausted']Failed
2['factory', 'inactive']['factory', [1, 2]]Failed
3['factory', 'inactive']['factory', []]Failed
4['exhausted', 'inactive']['exhausted', 'inactive']Passed
5['factory', 'inactive', 'factory', 'inactive']['factory', 'inactive', 'factory', [2]]Failed

SHA-256 / ad8579255419cc81d9123d791e87fad8eb96233a4eba20f072b05f4dfc97c853

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(events):
    recipe=[]; snapshot=(); body=[]; cursor=0; calls=0; limit=0; out=[]; active=False
    for e in events:
        if e[0] in ('open','new'):
            recipe=list(e[1]); limit=e[2]
            snapshot=tuple(recipe)
            calls=0
            active=False
        elif e[0]=='change': recipe[:]=e[1]
        elif e[0]=='attempt':
            if calls>=limit:
                out.append('exhausted'); active=False; continue
            body=list(snapshot)
            cursor=0
            calls+=1
            active=len(body)>0
            out.append('factory')
        elif e[0]=='read':
            if not active: out.append('inactive'); continue
            chunk=body[cursor:cursor+e[1]]
            cursor+=len(chunk)
            out.append(chunk)
    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',[N,N+1,N+2],2),('attempt',),('read',2),('read',1),('read',1),('attempt',),('read',3),('attempt',)]), ['factory',[N,N+1],[N+2],[],'factory',[N,N+1,N+2],'exhausted'])
check('2', solve([('open',[N,N+1],1),('change',[9]),('attempt',),('read',2)]), ['factory',[N,N+1]])
check('3', solve([('open',[],1),('attempt',),('read',1)]), ['factory',[]])
check('4', solve([('open',[N],0),('attempt',),('read',1)]), ['exhausted','inactive'])
check('5', solve([('open',[N],1),('attempt',),('new',[N+1],1),('read',1),('attempt',),('read',1)]), ['factory','inactive','factory',[N+1]])
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['factory', [1, 2], [3], [], 'factory', [1, 2, 3], 'exhausted']['factory', [1, 2], [3], [], 'factory', [1, 2, 3], 'exhausted']Passed
2['factory', [1, 2]]['factory', [1, 2]]Passed
3['factory', 'inactive']['factory', []]Failed
4['exhausted', 'inactive']['exhausted', 'inactive']Passed
5['factory', 'inactive', 'factory', [2]]['factory', 'inactive', 'factory', [2]]Passed

SHA-256 / 400c77b75e65a768da9fc561f43cb003200038b0f83204f0b88b7024b147a07a

3 / The verified repair

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

N = 1
observations = []
def solve(events):
    recipe=[]; snapshot=(); body=[]; cursor=0; calls=0; limit=0; out=[]; active=False
    for e in events:
        if e[0] in ('open','new'):
            recipe=list(e[1]); limit=e[2]
            snapshot=tuple(recipe)
            calls=0
            active=False
        elif e[0]=='change': recipe[:]=e[1]
        elif e[0]=='attempt':
            if calls>=limit:
                out.append('exhausted'); active=False; continue
            body=list(snapshot)
            cursor=0
            calls+=1
            active=True
            out.append('factory')
        elif e[0]=='read':
            if not active: out.append('inactive'); continue
            chunk=body[cursor:cursor+e[1]]
            cursor+=len(chunk)
            out.append(chunk)
    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',[N,N+1,N+2],2),('attempt',),('read',2),('read',1),('read',1),('attempt',),('read',3),('attempt',)]), ['factory',[N,N+1],[N+2],[],'factory',[N,N+1,N+2],'exhausted'])
check('2', solve([('open',[N,N+1],1),('change',[9]),('attempt',),('read',2)]), ['factory',[N,N+1]])
check('3', solve([('open',[],1),('attempt',),('read',1)]), ['factory',[]])
check('4', solve([('open',[N],0),('attempt',),('read',1)]), ['exhausted','inactive'])
check('5', solve([('open',[N],1),('attempt',),('new',[N+1],1),('read',1),('attempt',),('read',1)]), ['factory','inactive','factory',[N+1]])
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['factory', [1, 2], [3], [], 'factory', [1, 2, 3], 'exhausted']['factory', [1, 2], [3], [], 'factory', [1, 2, 3], 'exhausted']Passed
2['factory', [1, 2]]['factory', [1, 2]]Passed
3['factory', []]['factory', []]Passed
4['exhausted', 'inactive']['exhausted', 'inactive']Passed
5['factory', 'inactive', 'factory', [2]]['factory', 'inactive', 'factory', [2]]Passed

SHA-256 / 583b9d90190284a19466c10aa3e48e7523c10605c9675147686d38e8c17a45fd

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

Case digest / 329821ee9ce5f6a32082ffe17bd6284259c4f890aed90b57760e6d397a738a0d