Hmbown/CodeWhale · error · PersistenceBacklogError

accepted_requests must equal requests_attempted; sender reje

Error message

accepted_requests must equal requests_attempted; sender rejection is not backlog improvement

What it means

Raised in validate_receipt (scripts/check-persistence-backlog-budget.py:183-188) when accepted_requests != requests_attempted (the frozen fixture pins requests_attempted to 128, so accepted must be exactly 128). The gate encodes a measurement invariant: the sender must accept every request, because shrinking the backlog by having the channel reject sends is not a real persistence improvement.

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 8880682c63)

Solutions

  1. Fix the measurement test so all 128 requests are accepted before the consumer pauses, then re-measure.
  2. If the channel semantics intentionally changed, re-baseline the fixture and budget through the documented migration rather than tolerating rejections.
  3. Inspect the receipt's accepted_requests to confirm which side (emitter vs actor) diverged.

Example fix

// receipt (before)
"requests_attempted": 128, "accepted_requests": 120
// receipt (after)
"requests_attempted": 128, "accepted_requests": 128
Defensive patterns

Strategy: validation

Validate before calling

if receipt["accepted_requests"] != receipt["requests_attempted"]:
    sys.exit("actor rejected sends; fix the measurement harness before budgeting")

Try / catch

try:
    validate_receipt(receipt)
except PersistenceBacklogError as e:
    if "sender rejection" in str(e):
        raise RuntimeError("persistence channel rejected fixture requests; not a backlog result") from e
    raise

Prevention

When it happens

Trigger: A measurement run where the actor's persistence channel rejected or dropped some of the 128 fixture requests (channel capacity/buffer changes, backpressure behavior change, test restructure that drains differently).

Common situations: Refactoring the persistence actor's channel so it no longer unconditionally accepts before pausing; a regression where bounded-send starts failing under the fixture load.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@8880682c63 (2026-08-16). Data as JSON: /api/errors/1ae72b2cf40de704. Report an issue: GitHub.