FAILURE MAP
← Case archive

FA-30531 / HTTP retries / Open access

Bounded body spooling for replay: Total limit violates retry transition semantics · case 01

Total limit violates retry transition semantics

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

ROOT CAUSE

Total limit violates retry transition semantics

VERIFIED REPAIR

Restore the specified transition limit=e[2].

Unsuccessful approach: The attempted repair changes the faulty site to limit=e[2]+1 but still violates a regression oracle.

Case contract

open(memory threshold,total limit) begins capturing byte-list chunks. append stores an entire chunk only if total limit permits; crossing memory threshold spills all prior memory and new chunk to modeled disk. fail_disk invalidates captured body. seal finalizes; replay returns captured bytes only when sealed and valid. Overflow is terminal until next open. Return replay decisions and storage mode.

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):
    threshold=0; limit=0; memory=[]; disk=[]; size=0; mode='memory'; state='idle'; out=[]
    for e in events:
        if e[0]=='open':
            threshold=e[1]; limit=e[1]; memory=[]; disk=[]; size=0; mode='memory'; state='capturing'
        elif e[0]=='append':
            if state!='capturing': continue
            chunk=list(e[1])
            if size+len(chunk)>limit:
                state='overflow'; memory=[]; disk=[]; continue
            if mode=='memory' and size+len(chunk)>threshold:
                disk=list(memory); memory=[]; mode='disk'
            if mode=='disk': disk.extend(chunk)
            else: memory.extend(chunk)
            size+=len(chunk)
        elif e[0]=='seal':
            if state=='capturing': state='sealed'
        elif e[0]=='fail_disk':
            if mode=='disk': state='io-error'; memory=[]; disk=[]
        elif e[0]=='replay':
            if state!='sealed': out.append(state); continue
            out.append(list(disk if mode=='disk' else memory))
    return [out,mode]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [[],'memory'])
check('1', solve([('open',3,8),('append',[N,N+1]),('append',[N+2]),('seal',),('replay',)]), [[[N,N+1,N+2]],'memory'])
check('2', solve([('open',2,8),('append',[N,N+1]),('append',[N+2,N+3]),('append',[N+4]),('seal',),('replay',)]), [[[N,N+1,N+2,N+3,N+4]],'disk'])
check('3', solve([('open',2,3),('append',[N,N+1]),('append',[N+2]),('append',[N+3]),('seal',),('replay',)]), [['overflow'],'disk'])
check('4', solve([('open',0,4),('append',[N]),('fail_disk',),('seal',),('replay',),('open',4,4),('append',[N+1]),('seal',),('replay',)]), [['io-error',[N+1]],'memory'])
check('5', solve([('open',2,2),('append',[N]),('replay',),('seal',),('append',[N+1]),('replay',)]), [['capturing',[N]],'memory'])
check('6', solve([('open',0,0),('append',[]),('seal',),('replay',)]), [[[]],'memory'])
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[[], 'memory'][[], 'memory']Passed
1[[[1, 2, 3]], 'memory'][[[1, 2, 3]], 'memory']Passed
2[['overflow'], 'memory'][[[1, 2, 3, 4, 5]], 'disk']Failed
3[['overflow'], 'memory'][['overflow'], 'disk']Failed
4[['overflow', [2]], 'memory'][['io-error', [2]], 'memory']Failed
5[['capturing', [1]], 'memory'][['capturing', [1]], 'memory']Passed
6[[[]], 'memory'][[[]], 'memory']Passed

SHA-256 / adb62037859a175d4c1c52e8a82aeca2b746cd3102507d5f6621f7ea9eef1d9b

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(events):
    threshold=0; limit=0; memory=[]; disk=[]; size=0; mode='memory'; state='idle'; out=[]
    for e in events:
        if e[0]=='open':
            threshold=e[1]; limit=e[2]+1; memory=[]; disk=[]; size=0; mode='memory'; state='capturing'
        elif e[0]=='append':
            if state!='capturing': continue
            chunk=list(e[1])
            if size+len(chunk)>limit:
                state='overflow'; memory=[]; disk=[]; continue
            if mode=='memory' and size+len(chunk)>threshold:
                disk=list(memory); memory=[]; mode='disk'
            if mode=='disk': disk.extend(chunk)
            else: memory.extend(chunk)
            size+=len(chunk)
        elif e[0]=='seal':
            if state=='capturing': state='sealed'
        elif e[0]=='fail_disk':
            if mode=='disk': state='io-error'; memory=[]; disk=[]
        elif e[0]=='replay':
            if state!='sealed': out.append(state); continue
            out.append(list(disk if mode=='disk' else memory))
    return [out,mode]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [[],'memory'])
check('1', solve([('open',3,8),('append',[N,N+1]),('append',[N+2]),('seal',),('replay',)]), [[[N,N+1,N+2]],'memory'])
check('2', solve([('open',2,8),('append',[N,N+1]),('append',[N+2,N+3]),('append',[N+4]),('seal',),('replay',)]), [[[N,N+1,N+2,N+3,N+4]],'disk'])
check('3', solve([('open',2,3),('append',[N,N+1]),('append',[N+2]),('append',[N+3]),('seal',),('replay',)]), [['overflow'],'disk'])
check('4', solve([('open',0,4),('append',[N]),('fail_disk',),('seal',),('replay',),('open',4,4),('append',[N+1]),('seal',),('replay',)]), [['io-error',[N+1]],'memory'])
check('5', solve([('open',2,2),('append',[N]),('replay',),('seal',),('append',[N+1]),('replay',)]), [['capturing',[N]],'memory'])
check('6', solve([('open',0,0),('append',[]),('seal',),('replay',)]), [[[]],'memory'])
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[[], 'memory'][[], 'memory']Passed
1[[[1, 2, 3]], 'memory'][[[1, 2, 3]], 'memory']Passed
2[[[1, 2, 3, 4, 5]], 'disk'][[[1, 2, 3, 4, 5]], 'disk']Passed
3[[[1, 2, 3, 4]], 'disk'][['overflow'], 'disk']Failed
4[['io-error', [2]], 'memory'][['io-error', [2]], 'memory']Passed
5[['capturing', [1]], 'memory'][['capturing', [1]], 'memory']Passed
6[[[]], 'memory'][[[]], 'memory']Passed

SHA-256 / 05d3bafaa66a82166180c573f55eb2ba74990890c873642157a63c6ec3304106

3 / The verified repair

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

N = 1
observations = []
def solve(events):
    threshold=0; limit=0; memory=[]; disk=[]; size=0; mode='memory'; state='idle'; out=[]
    for e in events:
        if e[0]=='open':
            threshold=e[1]; limit=e[2]; memory=[]; disk=[]; size=0; mode='memory'; state='capturing'
        elif e[0]=='append':
            if state!='capturing': continue
            chunk=list(e[1])
            if size+len(chunk)>limit:
                state='overflow'; memory=[]; disk=[]; continue
            if mode=='memory' and size+len(chunk)>threshold:
                disk=list(memory); memory=[]; mode='disk'
            if mode=='disk': disk.extend(chunk)
            else: memory.extend(chunk)
            size+=len(chunk)
        elif e[0]=='seal':
            if state=='capturing': state='sealed'
        elif e[0]=='fail_disk':
            if mode=='disk': state='io-error'; memory=[]; disk=[]
        elif e[0]=='replay':
            if state!='sealed': out.append(state); continue
            out.append(list(disk if mode=='disk' else memory))
    return [out,mode]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [[],'memory'])
check('1', solve([('open',3,8),('append',[N,N+1]),('append',[N+2]),('seal',),('replay',)]), [[[N,N+1,N+2]],'memory'])
check('2', solve([('open',2,8),('append',[N,N+1]),('append',[N+2,N+3]),('append',[N+4]),('seal',),('replay',)]), [[[N,N+1,N+2,N+3,N+4]],'disk'])
check('3', solve([('open',2,3),('append',[N,N+1]),('append',[N+2]),('append',[N+3]),('seal',),('replay',)]), [['overflow'],'disk'])
check('4', solve([('open',0,4),('append',[N]),('fail_disk',),('seal',),('replay',),('open',4,4),('append',[N+1]),('seal',),('replay',)]), [['io-error',[N+1]],'memory'])
check('5', solve([('open',2,2),('append',[N]),('replay',),('seal',),('append',[N+1]),('replay',)]), [['capturing',[N]],'memory'])
check('6', solve([('open',0,0),('append',[]),('seal',),('replay',)]), [[[]],'memory'])
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[[], 'memory'][[], 'memory']Passed
1[[[1, 2, 3]], 'memory'][[[1, 2, 3]], 'memory']Passed
2[[[1, 2, 3, 4, 5]], 'disk'][[[1, 2, 3, 4, 5]], 'disk']Passed
3[['overflow'], 'disk'][['overflow'], 'disk']Passed
4[['io-error', [2]], 'memory'][['io-error', [2]], 'memory']Passed
5[['capturing', [1]], 'memory'][['capturing', [1]], 'memory']Passed
6[[[]], 'memory'][[[]], 'memory']Passed

SHA-256 / 3d1804eb8df0a19e00936722d7d55e99e0d04122b7e9e2e9505ea59b66387cb9

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

Case digest / 6f9b983ad289aa2b35c21faff652a35319d53eaa850ee2c5b712d50b22b002bc