FAILURE MAP
← Case archive

FA-1371 / Concurrency / Open access

Acquire a distributed mutex: A request acquires a lock in another coordination namespace · case 01

The distributed lock operation is admitted even though a request acquires a lock in another coordination namespace.

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

ROOT CAUSE

The admission path omits the lock namespace invariant while validating the other operation preconditions.

THE FAILURE

The admission path omits the lock namespace invariant while validating the other operation preconditions.

Unsuccessful approach: Adding the lock namespace check repairs the reported defect, but replacing the adjacent lock available check loses that independent invariant.

Case contract

Return a Boolean admission decision for acquire a distributed mutex. The record r must satisfy all of: r['lock_available'] is None; r['waiter_turn'][0] == r['waiter_turn'][1][0]; r['owner_session'][0] < r['owner_session'][1]; r['fence_increase'][0] > r['fence_increase'][1]; r['lock_namespace'][0] == r['lock_namespace'][1]. Extra tracing fields are ignored; validation does not mutate the record.

Why this case matters

A deterministic local contract for concurrency. Each negative fixture violates exactly one invariant. No transport timing, persistence, cryptographic verification, or full protocol implementation is claimed.

1 / The failure

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

N = 1
observations = []
def solve(r):
    return (r['lock_available'] is None) and (r['waiter_turn'][0] == r['waiter_turn'][1][0]) and (r['owner_session'][0] < r['owner_session'][1]) and (r['fence_increase'][0] > r['fence_increase'][1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'lock_available': None, 'waiter_turn': ['a', ['a', 'b']], 'owner_session': [9, 10], 'fence_increase': [7, 6], 'lock_namespace': ['n1', 'n1']}
check('valid operation', solve(r), True)
check('Acquisition steals a currently held mutex', solve(dict(r, **{'lock_available': 'owner'})), False)
check('A newcomer bypasses the oldest eligible waiter', solve(dict(r, **{'waiter_turn': ['b', ['a', 'b']]})), False)
check('An expired session acquires a new mutex', solve(dict(r, **{'owner_session': [10, 10]})), False)
check('Reacquisition reuses the previous fencing token', solve(dict(r, **{'fence_increase': [6, 6]})), False)
check('A request acquires a lock in another coordination namespace', solve(dict(r, **{'lock_namespace': ['n2', 'n1']})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'lock_available': 'owner', 'waiter_turn': ['b', ['a', 'b']], 'owner_session': [10, 10], 'fence_increase': [6, 6], 'lock_namespace': ['n2', 'n1']}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), False)
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
valid operationTrueTruePassed
Acquisition steals a currently held mutexFalseFalsePassed
A newcomer bypasses the oldest eligible waiterFalseFalsePassed
An expired session acquires a new mutexFalseFalsePassed
Reacquisition reuses the previous fencing tokenFalseFalsePassed
A request acquires a lock in another coordination namespaceTrueFalseFailed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / 90a7e85e3b4b559680f11ed78579a65d29f83908ba249be5992568e8a7e57cce

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(r):
    return (r['waiter_turn'][0] == r['waiter_turn'][1][0]) and (r['owner_session'][0] < r['owner_session'][1]) and (r['fence_increase'][0] > r['fence_increase'][1]) and (r['lock_namespace'][0] == r['lock_namespace'][1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'lock_available': None, 'waiter_turn': ['a', ['a', 'b']], 'owner_session': [9, 10], 'fence_increase': [7, 6], 'lock_namespace': ['n1', 'n1']}
check('valid operation', solve(r), True)
check('Acquisition steals a currently held mutex', solve(dict(r, **{'lock_available': 'owner'})), False)
check('A newcomer bypasses the oldest eligible waiter', solve(dict(r, **{'waiter_turn': ['b', ['a', 'b']]})), False)
check('An expired session acquires a new mutex', solve(dict(r, **{'owner_session': [10, 10]})), False)
check('Reacquisition reuses the previous fencing token', solve(dict(r, **{'fence_increase': [6, 6]})), False)
check('A request acquires a lock in another coordination namespace', solve(dict(r, **{'lock_namespace': ['n2', 'n1']})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'lock_available': 'owner', 'waiter_turn': ['b', ['a', 'b']], 'owner_session': [10, 10], 'fence_increase': [6, 6], 'lock_namespace': ['n2', 'n1']}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), False)
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
valid operationTrueTruePassed
Acquisition steals a currently held mutexTrueFalseFailed
A newcomer bypasses the oldest eligible waiterFalseFalsePassed
An expired session acquires a new mutexFalseFalsePassed
Reacquisition reuses the previous fencing tokenFalseFalsePassed
A request acquires a lock in another coordination namespaceFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / 95328248e292feb81a5783dba8c8e0b51c6f7d0418cdefd77c33addc5a0444c2

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 9 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

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

Case digest / 93be89a9bbe14c334c36af463713be42ba967a8bce2935442e37eac7b1e273e1