FAILURE MAP
← Case archive

FA-29526 / HTTP retries / Open access

Nested client retry ownership: A failure outside a retry scope is converted to an owned retry outcome · case 01

A failure outside a retry scope is converted to an owned retry outcome

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

ROOT CAUSE

A failure outside a retry scope is converted to an owned retry outcome

THE FAILURE

A failure outside a retry scope is converted to an owned retry outcome

Unsuccessful approach: The attempted repair changes the faulty site to ['exhausted',None] but still violates a regression oracle.

Case contract

enter(layer, allowance) pushes a retry scope. A child with any ancestor delegates retry to the oldest scope and never spends its local cap. fail returns retry/exhausted charged to oldest scope. leave pops the current scope; success clears every scope. Return decision pairs and remaining scope budgets.

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):
    stack=[]; out=[]
    for e in events:
        if e[0]=='enter':
            stack.append([e[1],e[2],0])
        elif e[0]=='leave':
            if stack: stack.pop()
        elif e[0]=='success':
            stack.clear()
        elif e[0]=='fail':
            if not stack:
                out.append(['retry',None]); continue
            owner=stack[0]
            if owner[2]>=owner[1]:
                out.append(['exhausted',owner[0]])
            else:
                owner[2]+=1
                out.append(['retry',owner[0]])
    return [out,stack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [[],[]])
check('1', solve([('fail',)]), [[['unowned',None]],[]])
check('2', solve([('enter','outer',2),('enter','inner',9),('fail',),('fail',),('fail',)]), [[['retry','outer'],['retry','outer'],['exhausted','outer']],[['outer',2,2],['inner',9,0]]])
check('3', solve([('enter','only',N),('fail',)]), [[['retry','only']],[['only',N,1]]])
check('4', solve([('enter','outer',1),('enter','inner',1),('leave',),('fail',)]), [[['retry','outer']],[['outer',1,1]]])
check('5', solve([('enter','a',0),('enter','b',N),('success',),('fail',)]), [[['unowned',None]],[]])
check('6', solve([('enter','a',0),('fail',),('leave',),('leave',)]), [[['exhausted','a']],[]])
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[[['retry', None]], []][[['unowned', None]], []]Failed
2[[['retry', 'outer'], ['retry', 'outer'], ['exhausted', 'outer']], [['outer', 2, 2], ['inner', 9, 0]]][[['retry', 'outer'], ['retry', 'outer'], ['exhausted', 'outer']], [['outer', 2, 2], ['inner', 9, 0]]]Passed
3[[['retry', 'only']], [['only', 1, 1]]][[['retry', 'only']], [['only', 1, 1]]]Passed
4[[['retry', 'outer']], [['outer', 1, 1]]][[['retry', 'outer']], [['outer', 1, 1]]]Passed
5[[['retry', None]], []][[['unowned', None]], []]Failed
6[[['exhausted', 'a']], []][[['exhausted', 'a']], []]Passed

SHA-256 / 2cee53abda2c78a0ad497a98385f7f50d92ace4394f99b9ab0da4d87004b48a3

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(events):
    stack=[]; out=[]
    for e in events:
        if e[0]=='enter':
            stack.append([e[1],e[2],0])
        elif e[0]=='leave':
            if stack: stack.pop()
        elif e[0]=='success':
            stack.clear()
        elif e[0]=='fail':
            if not stack:
                out.append(['exhausted',None]); continue
            owner=stack[0]
            if owner[2]>=owner[1]:
                out.append(['exhausted',owner[0]])
            else:
                owner[2]+=1
                out.append(['retry',owner[0]])
    return [out,stack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [[],[]])
check('1', solve([('fail',)]), [[['unowned',None]],[]])
check('2', solve([('enter','outer',2),('enter','inner',9),('fail',),('fail',),('fail',)]), [[['retry','outer'],['retry','outer'],['exhausted','outer']],[['outer',2,2],['inner',9,0]]])
check('3', solve([('enter','only',N),('fail',)]), [[['retry','only']],[['only',N,1]]])
check('4', solve([('enter','outer',1),('enter','inner',1),('leave',),('fail',)]), [[['retry','outer']],[['outer',1,1]]])
check('5', solve([('enter','a',0),('enter','b',N),('success',),('fail',)]), [[['unowned',None]],[]])
check('6', solve([('enter','a',0),('fail',),('leave',),('leave',)]), [[['exhausted','a']],[]])
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[[['exhausted', None]], []][[['unowned', None]], []]Failed
2[[['retry', 'outer'], ['retry', 'outer'], ['exhausted', 'outer']], [['outer', 2, 2], ['inner', 9, 0]]][[['retry', 'outer'], ['retry', 'outer'], ['exhausted', 'outer']], [['outer', 2, 2], ['inner', 9, 0]]]Passed
3[[['retry', 'only']], [['only', 1, 1]]][[['retry', 'only']], [['only', 1, 1]]]Passed
4[[['retry', 'outer']], [['outer', 1, 1]]][[['retry', 'outer']], [['outer', 1, 1]]]Passed
5[[['exhausted', None]], []][[['unowned', None]], []]Failed
6[[['exhausted', 'a']], []][[['exhausted', 'a']], []]Passed

SHA-256 / 4346f4fa975bbb9b729424c48c6c5ca9b8f941469f69be64c6409177c5e324d4

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

Case digest / d9c3745fe9ce17c911b04318420a7e7676e68b42803007dad0135782e24d10fd