FAILURE MAP
← Case archive

FA-27191 / HTTP ranges / Open access

Concurrent download clients share bounded origin range reads: canceled consumers do not schedule more origin byte reads · case 01

Concurrent download clients share bounded origin range reads: canceled consumers do not schedule more origin byte reads.

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

ROOT CAUSE

The range-fetch-round-robin-cancelled-job decision uses queues={} order=[] for client,start,count,cancelled in x['jobs']: if count==0: continue if client not in queues: queues[client]=[] order.append(client) queues[client].append([start,count]) out=[] for slot in range(x['slots']): if not order: break client=order.pop(0) start,count=queues[client][0] amount=min(count,x['chunk']) out.append([client,start,amount]) if amount==count: queues[client].pop(0) else: queues[client][0]=[start+amount,count-amount] if queues[client]: order.append(client) pending=[[client,start,count] for client in order for start,count in queues[client]] return [out,pending].

THE FAILURE

The range-fetch-round-robin-cancelled-job decision uses queues={} order=[] for client,start,count,cancelled in x['jobs']: if count==0: continue if client not in queues: queues[client]=[] order.append(client) queues[client].append([start,count]) out=[] for slot in range(x['slots']): if not order: break client=order.pop(0) start,count=queues[client][0] amount=min(count,x['chunk']) out.append([client,start,amount]) if amount==count: queues[client].pop(0) else: queues[client][0]=[start+amount,count-amount] if queues[client]: order.append(client) pending=[[client,start,count] for client in order for start,count in queues[client]] return [out,pending].

Unsuccessful approach: The partial repair uses queues={} order=[] for client,start,count,cancelled in x['jobs']: if cancelled and count==0: continue if client not in queues: queues[client]=[] order.append(client) queues[client].append([start,count]) out=[] for slot in range(x['slots']): if not order: break client=order.pop(0) start,count=queues[client][0] amount=min(count,x['chunk']) out.append([client,start,amount]) if amount==count: queues[client].pop(0) else: queues[client][0]=[start+amount,count-amount] if queues[client]: order.append(client) pending=[[client,start,count] for client in order for start,count in queues[client]] return [out,pending], which still violates the stated contract.

Case contract

x contains ordered jobs [client,absolute-start,count,cancelled], positive chunk size, and dispatch slot count. Drop canceled and zero-length jobs. Maintain first-appearance client order; each client has FIFO requests. Dispatch at most one chunk per client per round, rotate unfinished clients, split long ranges, and remove exhausted requests. Return [dispatches,pending-jobs], where dispatches are [client,start,count] and pending jobs retain scheduler order. This models range-specific origin request scheduling, without network retries.

Why this case matters

Range responses combine representation identity, conditional requests, framing, and partial-object state.

1 / The failure

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

N = 1
observations = []
def solve(x):
    queues={}
    order=[]
    for client,start,count,cancelled in x['jobs']:
        if count==0: continue
        if client not in queues:
            queues[client]=[]
            order.append(client)
        queues[client].append([start,count])
    out=[]
    for slot in range(x['slots']):
        if not order: break
        client=order.pop(0)
        start,count=queues[client][0]
        amount=min(count,x['chunk'])
        out.append([client,start,amount])
        if amount==count:
            queues[client].pop(0)
        else:
            queues[client][0]=[start+amount,count-amount]
        if queues[client]: order.append(client)
    pending=[[client,start,count] for client in order for start,count in queues[client]]
    return [out,pending]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cancelled-job fixture 0', json.loads(json.dumps(solve({'jobs':[['a',0,5,False],['b',10,2,False]],'chunk':2,'slots':4}))), json.loads(json.dumps([[['a',0,2],['b',10,2],['a',2,2],['a',4,1]],[]])))
check('cancelled-job fixture 1', json.loads(json.dumps(solve({'jobs':[['b',10,2,False],['a',0,2,False]],'chunk':1,'slots':2}))), json.loads(json.dumps([[['b',10,1],['a',0,1]],[['b',11,1],['a',1,1]]])))
check('cancelled-job fixture 2', json.loads(json.dumps(solve({'jobs':[['a',0,0,False],['b',10,2,True]],'chunk':1,'slots':2}))), json.loads(json.dumps([[],[]])))
check('cancelled-job fixture 3', json.loads(json.dumps(solve({'jobs':[['a',0,2,False],['a',9,1,False],['b',4,1,False]],'chunk':2,'slots':2}))), json.loads(json.dumps([[['a',0,2],['b',4,1]],[['a',9,1]]])))
check('cancelled-job fixture 4', json.loads(json.dumps(solve({'jobs':[['a',0,2,False]],'chunk':2,'slots':0}))), json.loads(json.dumps([[],[['a',0,2]]])))
check('cancelled-job fixture 5', json.loads(json.dumps(solve({'jobs':[['a',0,2,False],['a',8,1,False]],'chunk':2,'slots':0}))), json.loads(json.dumps([[],[['a',0,2],['a',8,1]]])))
check('cancelled-job fixture 6', json.loads(json.dumps(solve({'jobs':[['a',N,N+1,False]],'chunk':N,'slots':1}))), json.loads(json.dumps([[['a',N,N]],[['a',2*N,1]]])))
check('cancelled-job fixture 7', json.loads(json.dumps(solve({'jobs':[['a',0,1,False]],'chunk':3,'slots':2}))), json.loads(json.dumps([[['a',0,1]],[]])))
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
cancelled-job fixture 0[[['a', 0, 2], ['b', 10, 2], ['a', 2, 2], ['a', 4, 1]], []][[['a', 0, 2], ['b', 10, 2], ['a', 2, 2], ['a', 4, 1]], []]Passed
cancelled-job fixture 1[[['b', 10, 1], ['a', 0, 1]], [['b', 11, 1], ['a', 1, 1]]][[['b', 10, 1], ['a', 0, 1]], [['b', 11, 1], ['a', 1, 1]]]Passed
cancelled-job fixture 2[[['b', 10, 1], ['b', 11, 1]], []][[], []]Failed
cancelled-job fixture 3[[['a', 0, 2], ['b', 4, 1]], [['a', 9, 1]]][[['a', 0, 2], ['b', 4, 1]], [['a', 9, 1]]]Passed
cancelled-job fixture 4[[], [['a', 0, 2]]][[], [['a', 0, 2]]]Passed
cancelled-job fixture 5[[], [['a', 0, 2], ['a', 8, 1]]][[], [['a', 0, 2], ['a', 8, 1]]]Passed
cancelled-job fixture 6[[['a', 1, 1]], [['a', 2, 1]]][[['a', 1, 1]], [['a', 2, 1]]]Passed
cancelled-job fixture 7[[['a', 0, 1]], []][[['a', 0, 1]], []]Passed

SHA-256 / ebd93511c54ce1bc51bc82c4e970f5edcc13744fd6cba1e4e5e423759666b1cd

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    queues={}
    order=[]
    for client,start,count,cancelled in x['jobs']:
        if cancelled and count==0: continue
        if client not in queues:
            queues[client]=[]
            order.append(client)
        queues[client].append([start,count])
    out=[]
    for slot in range(x['slots']):
        if not order: break
        client=order.pop(0)
        start,count=queues[client][0]
        amount=min(count,x['chunk'])
        out.append([client,start,amount])
        if amount==count:
            queues[client].pop(0)
        else:
            queues[client][0]=[start+amount,count-amount]
        if queues[client]: order.append(client)
    pending=[[client,start,count] for client in order for start,count in queues[client]]
    return [out,pending]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cancelled-job fixture 0', json.loads(json.dumps(solve({'jobs':[['a',0,5,False],['b',10,2,False]],'chunk':2,'slots':4}))), json.loads(json.dumps([[['a',0,2],['b',10,2],['a',2,2],['a',4,1]],[]])))
check('cancelled-job fixture 1', json.loads(json.dumps(solve({'jobs':[['b',10,2,False],['a',0,2,False]],'chunk':1,'slots':2}))), json.loads(json.dumps([[['b',10,1],['a',0,1]],[['b',11,1],['a',1,1]]])))
check('cancelled-job fixture 2', json.loads(json.dumps(solve({'jobs':[['a',0,0,False],['b',10,2,True]],'chunk':1,'slots':2}))), json.loads(json.dumps([[],[]])))
check('cancelled-job fixture 3', json.loads(json.dumps(solve({'jobs':[['a',0,2,False],['a',9,1,False],['b',4,1,False]],'chunk':2,'slots':2}))), json.loads(json.dumps([[['a',0,2],['b',4,1]],[['a',9,1]]])))
check('cancelled-job fixture 4', json.loads(json.dumps(solve({'jobs':[['a',0,2,False]],'chunk':2,'slots':0}))), json.loads(json.dumps([[],[['a',0,2]]])))
check('cancelled-job fixture 5', json.loads(json.dumps(solve({'jobs':[['a',0,2,False],['a',8,1,False]],'chunk':2,'slots':0}))), json.loads(json.dumps([[],[['a',0,2],['a',8,1]]])))
check('cancelled-job fixture 6', json.loads(json.dumps(solve({'jobs':[['a',N,N+1,False]],'chunk':N,'slots':1}))), json.loads(json.dumps([[['a',N,N]],[['a',2*N,1]]])))
check('cancelled-job fixture 7', json.loads(json.dumps(solve({'jobs':[['a',0,1,False]],'chunk':3,'slots':2}))), json.loads(json.dumps([[['a',0,1]],[]])))
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
cancelled-job fixture 0[[['a', 0, 2], ['b', 10, 2], ['a', 2, 2], ['a', 4, 1]], []][[['a', 0, 2], ['b', 10, 2], ['a', 2, 2], ['a', 4, 1]], []]Passed
cancelled-job fixture 1[[['b', 10, 1], ['a', 0, 1]], [['b', 11, 1], ['a', 1, 1]]][[['b', 10, 1], ['a', 0, 1]], [['b', 11, 1], ['a', 1, 1]]]Passed
cancelled-job fixture 2[[['a', 0, 0], ['b', 10, 1]], [['b', 11, 1]]][[], []]Failed
cancelled-job fixture 3[[['a', 0, 2], ['b', 4, 1]], [['a', 9, 1]]][[['a', 0, 2], ['b', 4, 1]], [['a', 9, 1]]]Passed
cancelled-job fixture 4[[], [['a', 0, 2]]][[], [['a', 0, 2]]]Passed
cancelled-job fixture 5[[], [['a', 0, 2], ['a', 8, 1]]][[], [['a', 0, 2], ['a', 8, 1]]]Passed
cancelled-job fixture 6[[['a', 1, 1]], [['a', 2, 1]]][[['a', 1, 1]], [['a', 2, 1]]]Passed
cancelled-job fixture 7[[['a', 0, 1]], []][[['a', 0, 1]], []]Passed

SHA-256 / b22f16c80223f39973fc2d525d2832d56b8aa3999bae0f0559756e3fdb33bb1a

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

Deterministic simplified range service, with stipulated local policies and already parsed trusted inputs; not a complete HTTP implementation. 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:22.873235+00:00.

Case digest / c5f4bba17d72f3e36e86985a97f8f7470b31f5dab55a4a61e723bae880a3e333