FA-1056 / Reliability / Open access
Finish draining a service instance: Shutdown terminates in-flight requests prematurely · case 01
The graceful drain operation is admitted even though shutdown terminates in-flight requests prematurely.
ROOT CAUSE
The admission path omits the inflight zero invariant while validating the other operation preconditions.
VERIFIED REPAIR
Require r['inflight_zero'] == 0 together with every other stated precondition before accepting the operation.
Unsuccessful approach: Adding the inflight zero check repairs the reported defect, but replacing the adjacent registration removed check loses that independent invariant.
Case contract
Return a Boolean admission decision for finish draining a service instance. The record r must satisfy all of: r['new_admission_closed'] is False; r['inflight_zero'] == 0; r['registration_removed'] is False; r['flush_complete'] is True; all(r['children_reaped']). Extra tracing fields are ignored; validation does not mutate the record.
Why this case matters
A deterministic local contract for reliability. 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['new_admission_closed'] is False) and (r['registration_removed'] is False) and (r['flush_complete'] is True) and (all(r['children_reaped']))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'new_admission_closed': False, 'inflight_zero': 0, 'registration_removed': False, 'flush_complete': True, 'children_reaped': [True, True]}
check('valid operation', solve(r), True)
check('Shutdown still permits new work to enter', solve(dict(r, **{'new_admission_closed': True})), False)
check('Shutdown terminates in-flight requests prematurely', solve(dict(r, **{'inflight_zero': 1})), False)
check('Shutdown completes while routing still advertises the instance', solve(dict(r, **{'registration_removed': True})), False)
check('Shutdown discards buffered durable work', solve(dict(r, **{'flush_complete': False})), False)
check('Shutdown abandons child workers holding resources', solve(dict(r, **{'children_reaped': [True, False]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'new_admission_closed': True, 'inflight_zero': 1, 'registration_removed': True, 'flush_complete': False, 'children_reaped': [True, False]}
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| valid operation | True | True | Passed |
| Shutdown still permits new work to enter | False | False | Passed |
| Shutdown terminates in-flight requests prematurely | True | False | Failed |
| Shutdown completes while routing still advertises the instance | False | False | Passed |
| Shutdown discards buffered durable work | False | False | Passed |
| Shutdown abandons child workers holding resources | False | False | Passed |
| unrelated tracing metadata | True | True | Passed |
| repeat validation is pure | True | True | Passed |
| two independent violations in variant | False | False | Passed |
SHA-256 / 8a9a7751b3d8b8165ce6bcc11b85fe1d239bb679d1d4e65e743ef54c358fe119
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
return (r['new_admission_closed'] is False) and (r['inflight_zero'] == 0) and (r['flush_complete'] is True) and (all(r['children_reaped']))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'new_admission_closed': False, 'inflight_zero': 0, 'registration_removed': False, 'flush_complete': True, 'children_reaped': [True, True]}
check('valid operation', solve(r), True)
check('Shutdown still permits new work to enter', solve(dict(r, **{'new_admission_closed': True})), False)
check('Shutdown terminates in-flight requests prematurely', solve(dict(r, **{'inflight_zero': 1})), False)
check('Shutdown completes while routing still advertises the instance', solve(dict(r, **{'registration_removed': True})), False)
check('Shutdown discards buffered durable work', solve(dict(r, **{'flush_complete': False})), False)
check('Shutdown abandons child workers holding resources', solve(dict(r, **{'children_reaped': [True, False]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'new_admission_closed': True, 'inflight_zero': 1, 'registration_removed': True, 'flush_complete': False, 'children_reaped': [True, False]}
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| valid operation | True | True | Passed |
| Shutdown still permits new work to enter | False | False | Passed |
| Shutdown terminates in-flight requests prematurely | False | False | Passed |
| Shutdown completes while routing still advertises the instance | True | False | Failed |
| Shutdown discards buffered durable work | False | False | Passed |
| Shutdown abandons child workers holding resources | False | False | Passed |
| unrelated tracing metadata | True | True | Passed |
| repeat validation is pure | True | True | Passed |
| two independent violations in variant | False | False | Passed |
SHA-256 / 131c092380d275fb96bcbe05f7c7670af77cbc05461e2cb16d6f72ae5a7d80bc
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
return (r['new_admission_closed'] is False) and (r['inflight_zero'] == 0) and (r['registration_removed'] is False) and (r['flush_complete'] is True) and (all(r['children_reaped']))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'new_admission_closed': False, 'inflight_zero': 0, 'registration_removed': False, 'flush_complete': True, 'children_reaped': [True, True]}
check('valid operation', solve(r), True)
check('Shutdown still permits new work to enter', solve(dict(r, **{'new_admission_closed': True})), False)
check('Shutdown terminates in-flight requests prematurely', solve(dict(r, **{'inflight_zero': 1})), False)
check('Shutdown completes while routing still advertises the instance', solve(dict(r, **{'registration_removed': True})), False)
check('Shutdown discards buffered durable work', solve(dict(r, **{'flush_complete': False})), False)
check('Shutdown abandons child workers holding resources', solve(dict(r, **{'children_reaped': [True, False]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'new_admission_closed': True, 'inflight_zero': 1, 'registration_removed': True, 'flush_complete': False, 'children_reaped': [True, False]}
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| valid operation | True | True | Passed |
| Shutdown still permits new work to enter | False | False | Passed |
| Shutdown terminates in-flight requests prematurely | False | False | Passed |
| Shutdown completes while routing still advertises the instance | False | False | Passed |
| Shutdown discards buffered durable work | False | False | Passed |
| Shutdown abandons child workers holding resources | False | False | Passed |
| unrelated tracing metadata | True | True | Passed |
| repeat validation is pure | True | True | Passed |
| two independent violations in variant | False | False | Passed |
SHA-256 / 650292b11afdedfeb927c183ceaa91bc1da76776d61ae01cd6a64070702fbc7f
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:36:58.492560+00:00.
Case digest / 915b903e3c94b9d97a39497b26a858c7ab0ebfe98d8bb8ecf414468f6c33e158