FAILURE MAP
← Case archive

FA-29981 / HTTP retries / Open access

Cancellation of queued retries: Due inclusive violates retry transition semantics · case 01

Due inclusive violates retry transition semantics

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

ROOT CAUSE

Due inclusive violates retry transition semantics

THE FAILURE

Due inclusive violates retry transition semantics

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

Case contract

schedule(id,due) replaces an existing queued retry for that ID. cancel(id) removes it and permanently cancels that logical request. poll(now) starts every due noncancelled retry ordered by due then ID and removes it before execution. finish records completion only for running retries. Cancelling running work removes running status; its late completion is ignored. Return start/finish events and pending/running IDs.

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):
    queued={}; running=set(); cancelled=set(); out=[]
    for e in events:
        if e[0]=='schedule':
            if e[1] in cancelled: continue
            if e[1] in running: continue
            queued[e[1]]=e[2]
        elif e[0]=='cancel':
            cancelled.add(e[1])
            queued.pop(e[1],None)
            running.discard(e[1])
        elif e[0]=='poll':
            ready=sorted((due,k) for k,due in queued.items() if due<e[1])
            for due,k in ready:
                queued.pop(k)
                running.add(k)
                out.append(['start',k])
        elif e[0]=='finish':
            if e[1] not in running: continue
            running.remove(e[1])
            out.append(['finish',e[1]])
    return [out,sorted(queued),sorted(running)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([('schedule','a',1),('schedule','a',N+5),('poll',1),('cancel','a'),('poll',N+5)]), [[],[],[]])
check('1', solve([]), [[],[],[]])
check('2', solve([('schedule','b',N),('schedule','a',N),('poll',N),('poll',N),('finish','a'),('finish','a')]), [[['start','a'],['start','b'],['finish','a']],[],['b']])
check('3', solve([('schedule','a',1),('schedule','a',N+5),('poll',1),('poll',N+5)]), [[['start','a']],[],['a']])
check('4', solve([('schedule','a',1),('schedule','b',2),('cancel','a'),('schedule','a',3),('poll',5)]), [[['start','b']],[],['b']])
check('5', solve([('schedule','a',1),('schedule','b',1),('poll',1),('cancel','a'),('finish','a')]), [[['start','a'],['start','b']],[],['b']])
check('6', solve([('schedule','a',1),('poll',1),('schedule','a',3),('poll',3),('finish','z')]), [[['start','a']],[],['a']])
check('7', solve([('schedule','z',1),('schedule','a',2),('poll',3)]), [[['start','z'],['start','a']],[],['a','z']])
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[[], [], []][[], [], []]Passed
2[[], ['a', 'b'], []][[['start', 'a'], ['start', 'b'], ['finish', 'a']], [], ['b']]Failed
3[[], ['a'], []][[['start', 'a']], [], ['a']]Failed
4[[['start', 'b']], [], ['b']][[['start', 'b']], [], ['b']]Passed
5[[], ['b'], []][[['start', 'a'], ['start', 'b']], [], ['b']]Failed
6[[], ['a'], []][[['start', 'a']], [], ['a']]Failed
7[[['start', 'z'], ['start', 'a']], [], ['a', 'z']][[['start', 'z'], ['start', 'a']], [], ['a', 'z']]Passed

SHA-256 / 7a59a2f9e291081faea6aba39160b6583bc6b52d66d33c6099e224210275cf11

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(events):
    queued={}; running=set(); cancelled=set(); out=[]
    for e in events:
        if e[0]=='schedule':
            if e[1] in cancelled: continue
            if e[1] in running: continue
            queued[e[1]]=e[2]
        elif e[0]=='cancel':
            cancelled.add(e[1])
            queued.pop(e[1],None)
            running.discard(e[1])
        elif e[0]=='poll':
            ready=sorted((due,k) for k,due in queued.items() if due>=e[1])
            for due,k in ready:
                queued.pop(k)
                running.add(k)
                out.append(['start',k])
        elif e[0]=='finish':
            if e[1] not in running: continue
            running.remove(e[1])
            out.append(['finish',e[1]])
    return [out,sorted(queued),sorted(running)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([('schedule','a',1),('schedule','a',N+5),('poll',1),('cancel','a'),('poll',N+5)]), [[],[],[]])
check('1', solve([]), [[],[],[]])
check('2', solve([('schedule','b',N),('schedule','a',N),('poll',N),('poll',N),('finish','a'),('finish','a')]), [[['start','a'],['start','b'],['finish','a']],[],['b']])
check('3', solve([('schedule','a',1),('schedule','a',N+5),('poll',1),('poll',N+5)]), [[['start','a']],[],['a']])
check('4', solve([('schedule','a',1),('schedule','b',2),('cancel','a'),('schedule','a',3),('poll',5)]), [[['start','b']],[],['b']])
check('5', solve([('schedule','a',1),('schedule','b',1),('poll',1),('cancel','a'),('finish','a')]), [[['start','a'],['start','b']],[],['b']])
check('6', solve([('schedule','a',1),('poll',1),('schedule','a',3),('poll',3),('finish','z')]), [[['start','a']],[],['a']])
check('7', solve([('schedule','z',1),('schedule','a',2),('poll',3)]), [[['start','z'],['start','a']],[],['a','z']])
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[[['start', 'a']], [], []][[], [], []]Failed
1[[], [], []][[], [], []]Passed
2[[['start', 'a'], ['start', 'b'], ['finish', 'a']], [], ['b']][[['start', 'a'], ['start', 'b'], ['finish', 'a']], [], ['b']]Passed
3[[['start', 'a']], [], ['a']][[['start', 'a']], [], ['a']]Passed
4[[], ['b'], []][[['start', 'b']], [], ['b']]Failed
5[[['start', 'a'], ['start', 'b']], [], ['b']][[['start', 'a'], ['start', 'b']], [], ['b']]Passed
6[[['start', 'a']], [], ['a']][[['start', 'a']], [], ['a']]Passed
7[[], ['a', 'z'], []][[['start', 'z'], ['start', 'a']], [], ['a', 'z']]Failed

SHA-256 / e9595b52a4b836f2db83fa857fd62fb911133c15b516e472765a02cc36c126e6

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 8 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:48.869660+00:00.

Case digest / 300421b180c547efd77ed5ac2da4c7ae168e3a65a89a2c633d8baa3781c5c1f0