FAILURE MAP
← Case archive

FA-29831 / HTTP retries / Open access

Expect-Continue request retry phases: Remaining body violates retry transition semantics · case 01

Remaining body violates retry transition semantics

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

ROOT CAUSE

Remaining body violates retry transition semantics

THE FAILURE

Remaining body violates retry transition semantics

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

Case contract

start(body size) starts awaiting permission. interim100 permits sending; other interim messages do not. tick permits optimistic sending after wait expiry. send(bytes) emits at most remaining body only in permitted phase. final(status) stops body transmission and records response. fail permits retry with the same full body only if zero body bytes were sent; otherwise ambiguous. retry resets the handshaking phase after retry permission. Return transmissions and decisions.

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):
    size=0; sent=0; phase='idle'; out=[]
    for e in events:
        if e[0]=='start':
            size=e[1]; sent=0; phase='waiting'
        elif e[0]=='interim':
            if e[1]==100 and phase=='waiting': phase='allowed'
        elif e[0]=='tick':
            if phase=='waiting': phase='allowed'
        elif e[0]=='send':
            if phase!='allowed': out.append('blocked'); continue
            count=min(e[1],size)
            sent+=count
            out.append(count)
        elif e[0]=='final':
            phase='done'; out.append(['response',e[1]])
        elif e[0]=='fail':
            if phase=='done': out.append('terminal'); continue
            phase='retry' if sent==0 else 'ambiguous'
            out.append(phase)
        elif e[0]=='retry':
            if phase!='retry': out.append('denied'); continue
            sent=0; phase='waiting'; out.append('restarted')
    return [out,sent]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [[],0])
check('1', solve([('start',N+3),('send',1),('interim',103),('send',1),('interim',100),('send',2),('send',N+3)]), [['blocked','blocked',2,N+1],N+3])
check('2', solve([('start',N),('fail',),('retry',),('send',1),('tick',),('send',N)]), [['retry','restarted','blocked',N],N])
check('3', solve([('start',2),('tick',),('send',1),('fail',),('retry',)]), [[1,'ambiguous','denied'],1])
check('4', solve([('start',N),('final',417),('interim',100),('tick',),('send',1),('fail',),('retry',)]), [[['response',417],'blocked','terminal','denied'],0])
check('5', solve([('start',2),('tick',),('send',2),('start',N),('fail',)]), [[2,'retry'],0])
check('6', solve([('start',0),('interim',100),('send',3),('send',0)]), [[0,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]Passed
1[['blocked', 'blocked', 2, 4], 6][['blocked', 'blocked', 2, 2], 4]Failed
2[['retry', 'restarted', 'blocked', 1], 1][['retry', 'restarted', 'blocked', 1], 1]Passed
3[[1, 'ambiguous', 'denied'], 1][[1, 'ambiguous', 'denied'], 1]Passed
4[[['response', 417], 'blocked', 'terminal', 'denied'], 0][[['response', 417], 'blocked', 'terminal', 'denied'], 0]Passed
5[[2, 'retry'], 0][[2, 'retry'], 0]Passed
6[[0, 0], 0][[0, 0], 0]Passed

SHA-256 / 8685a5b3453f7f8e05fe160f0c316eddb4b92a415ac24aabe5c9eb571d3c2a4e

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(events):
    size=0; sent=0; phase='idle'; out=[]
    for e in events:
        if e[0]=='start':
            size=e[1]; sent=0; phase='waiting'
        elif e[0]=='interim':
            if e[1]==100 and phase=='waiting': phase='allowed'
        elif e[0]=='tick':
            if phase=='waiting': phase='allowed'
        elif e[0]=='send':
            if phase!='allowed': out.append('blocked'); continue
            count=e[1]
            sent+=count
            out.append(count)
        elif e[0]=='final':
            phase='done'; out.append(['response',e[1]])
        elif e[0]=='fail':
            if phase=='done': out.append('terminal'); continue
            phase='retry' if sent==0 else 'ambiguous'
            out.append(phase)
        elif e[0]=='retry':
            if phase!='retry': out.append('denied'); continue
            sent=0; phase='waiting'; out.append('restarted')
    return [out,sent]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [[],0])
check('1', solve([('start',N+3),('send',1),('interim',103),('send',1),('interim',100),('send',2),('send',N+3)]), [['blocked','blocked',2,N+1],N+3])
check('2', solve([('start',N),('fail',),('retry',),('send',1),('tick',),('send',N)]), [['retry','restarted','blocked',N],N])
check('3', solve([('start',2),('tick',),('send',1),('fail',),('retry',)]), [[1,'ambiguous','denied'],1])
check('4', solve([('start',N),('final',417),('interim',100),('tick',),('send',1),('fail',),('retry',)]), [[['response',417],'blocked','terminal','denied'],0])
check('5', solve([('start',2),('tick',),('send',2),('start',N),('fail',)]), [[2,'retry'],0])
check('6', solve([('start',0),('interim',100),('send',3),('send',0)]), [[0,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]Passed
1[['blocked', 'blocked', 2, 4], 6][['blocked', 'blocked', 2, 2], 4]Failed
2[['retry', 'restarted', 'blocked', 1], 1][['retry', 'restarted', 'blocked', 1], 1]Passed
3[[1, 'ambiguous', 'denied'], 1][[1, 'ambiguous', 'denied'], 1]Passed
4[[['response', 417], 'blocked', 'terminal', 'denied'], 0][[['response', 417], 'blocked', 'terminal', 'denied'], 0]Passed
5[[2, 'retry'], 0][[2, 'retry'], 0]Passed
6[[3, 0], 3][[0, 0], 0]Failed

SHA-256 / 363e4ab04ca736da3b2197ea71bb636a0fe0b311dcfa5299d76ecfb6d637f994

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / a8007cb337785cdf7a0b447b7de573cdd5f2bd13d267fafdac0f8dfba335b906