FAILURE MAP
← Case archive

FA-29971 / HTTP retries / Open access

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

Cancel queued violates retry transition semantics

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

ROOT CAUSE

Cancel queued violates retry transition semantics

VERIFIED REPAIR

Restore the specified transition queued.pop(e[1],None).

Unsuccessful approach: The attempted repair changes the faulty site to queued.clear() 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("all",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']], [], ['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[[['start', 'a'], ['start', 'b']], [], ['a', '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[[['start', 'z'], ['start', 'a']], [], ['a', 'z']][[['start', 'z'], ['start', 'a']], [], ['a', 'z']]Passed

SHA-256 / 68bbe96e9f4849fee084d5e6adeb68aec5ca2bf2e1963576abcb7d743aa36338

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.clear()
            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[[['start', 'a'], ['start', 'b'], ['finish', 'a']], [], ['b']][[['start', 'a'], ['start', 'b'], ['finish', 'a']], [], ['b']]Passed
3[[['start', 'a']], [], ['a']][[['start', 'a']], [], ['a']]Passed
4[[], [], []][[['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[[['start', 'z'], ['start', 'a']], [], ['a', 'z']][[['start', 'z'], ['start', 'a']], [], ['a', 'z']]Passed

SHA-256 / a59a50a9fd55611df62cb4828ae229f44e81f54395994b25bcd3cb4695521f3e

3 / The verified repair

Exit 0
"""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[[['start', 'a'], ['start', 'b'], ['finish', 'a']], [], ['b']][[['start', 'a'], ['start', 'b'], ['finish', 'a']], [], ['b']]Passed
3[[['start', 'a']], [], ['a']][[['start', 'a']], [], ['a']]Passed
4[[['start', 'b']], [], ['b']][[['start', 'b']], [], ['b']]Passed
5[[['start', 'a'], ['start', 'b']], [], ['b']][[['start', 'a'], ['start', 'b']], [], ['b']]Passed
6[[['start', 'a']], [], ['a']][[['start', 'a']], [], ['a']]Passed
7[[['start', 'z'], ['start', 'a']], [], ['a', 'z']][[['start', 'z'], ['start', 'a']], [], ['a', 'z']]Passed

SHA-256 / 3a7527174aaf8aa72ac918b252ef08a54dbbcd638d1685afc44c535cb9e9739f

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

Case digest / eee3b356b5803e72672f1d26f73c49c86fe73fcbebafa52b9be644f31e20b8d8