Hmbown/CodeWhale · error · PersistenceBacklogError
accepted_requests must equal requests_attempted; sender…
Error message
accepted_requests must equal requests_attempted; sender rejection is not backlog improvement
What it means
validate_receipt enforces that accepted_requests equals requests_attempted in a persistence-backlog receipt. The frozen fixture sends 128 requests into a paused channel, so every request must be accepted by the sender; a mismatch means the sender dropped or rejected requests, which would fake a smaller backlog without actually reducing retained memory. The check guards against measurement results that 'improve' the backlog by shedding work instead of buffering it.
Solutions
- Regenerate the receipt with the unmodified scripts/measure-persistence-backlog.py so every attempted request is accepted.
- If running with --receipt, re-check that the receipt file was produced by the current measurement script, not edited by hand.
- Fix the sending harness so it never drops requests (retries or blocking enqueue) before re-measuring.
Example fix
// before receipt["accepted_requests"] = 127 # hand-adjusted to look smaller // after # regenerate via: python scripts/measure-persistence-backlog.py assert receipt["accepted_requests"] == receipt["requests_attempted"] == 128
Defensive patterns
Strategy: validation
Validate before calling
def receipt_counts_consistent(receipt):
return (
isinstance(receipt.get("accepted_requests"), int)
and isinstance(receipt.get("requests_attempted"), int)
and receipt["accepted_requests"] == receipt["requests_attempted"]
) Type guard
def is_non_negative_int(v):
return isinstance(v, int) and not isinstance(v, bool) and v >= 0 Try / catch
try:
compare(receipt, budget)
except PersistenceBacklogError as e:
print(f"[persistence-backlog-budget] ERROR: {e}", file=sys.stderr)
sys.exit(2) Prevention
- Always generate receipts with scripts/measure-persistence-backlog.py, never by hand.
- Assert accepted == attempted in the harness immediately after the send loop.
- Keep the fixture's requests_attempted and the sender's behavior in lockstep.
When it happens
Trigger: Raised by validate_receipt (invoked from validate_baseline_receipt and compare) when receipt['accepted_requests'] != receipt['requests_attempted'], i.e. the measurement harness reports fewer accepted than attempted requests.
Common situations: A modified measure-persistence-backlog.py that aborts sends on backpressure; a hand-edited or partially regenerated baseline receipt; a fixture change that alters requests_attempted without resyncing accepted_requests.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- the paused channel must retain the newest request and its…
- applied_version is not the final sent version
- estimated_retained_payload_bytes is smaller than the frozen…
- final_version_applied must be true
- limitations must be a non-empty string array
AI-assisted analysis of Hmbown/CodeWhale@433685b202 (2026-09-15).
Data as JSON: /api/errors/1ae72b2cf40de704.
Report an issue: GitHub.
Appendix: source
Thrown at scripts/check-persistence-backlog-budget.py:186
"rustc_version",
"cargo_version",
"build_profile",
"sample_count",
):
if receipt[field] != expected_source[field]:
raise PersistenceBacklogError(
f"receipt {field} does not match the checked source"
)
if require_clean_source and receipt["source_dirty"]:
raise PersistenceBacklogError("persistence measurement source tree is dirty")
platform = receipt["platform"]
if not isinstance(platform, str) or platform not in SUPPORTED_PLATFORMS:
raise PersistenceBacklogError("receipt platform is unsupported")
attempted = non_negative_integer(receipt["requests_attempted"], "requests_attempted")
accepted = non_negative_integer(receipt["accepted_requests"], "accepted_requests")
if accepted != attempted:
raise PersistenceBacklogError(
"accepted_requests must equal requests_attempted; sender rejection is not backlog improvement"
)
retained = non_negative_integer(
receipt["retained_queued_requests"], "retained_queued_requests"
)
if retained > accepted:
raise PersistenceBacklogError("retained_queued_requests exceeds accepted_requests")
for field in ("estimated_retained_payload_bytes", "enqueue_elapsed_ns"):
non_negative_integer(receipt[field], field)
if retained == 0 or receipt["estimated_retained_payload_bytes"] == 0:
raise PersistenceBacklogError(
"the paused channel must retain the newest request and its payload"
)
minimum_payload_bytes = retained * FIXTURE["content_bytes_per_request"]
if receipt["estimated_retained_payload_bytes"] < minimum_payload_bytes:
raise PersistenceBacklogError(
"estimated_retained_payload_bytes is smaller than the frozen retained content"
)View on GitHub (pinned to 433685b202)