Hmbown/CodeWhale · error · PersistenceBacklogError

the paused channel must retain the newest request and its pa

Error message

the paused channel must retain the newest request and its payload

What it means

Raised in validate_receipt (scripts/check-persistence-backlog-budget.py:196-199) when retained_queued_requests == 0 or estimated_retained_payload_bytes == 0. The fixture's whole premise is a paused consumer that still holds the newest request and its payload, so a zero on either side means the measurement did not actually exercise a paused backlog.

Source

Thrown at scripts/check-persistence-backlog-budget.py:197

    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"
        )
    applied = non_negative_integer(
        receipt["applied_version"], "applied_version"
    )
    if applied != FIXTURE["expected_applied_version"]:
        raise PersistenceBacklogError("applied_version is not the final sent version")
    if receipt["final_version_applied"] is not True:
        raise PersistenceBacklogError("final_version_applied must be true")

    limitations = receipt["limitations"]
    if not isinstance(limitations, list) or not limitations or not all(
        isinstance(item, str) and item for item in limitations

View on GitHub (pinned to 8880682c63)

Solutions

  1. Ensure the measurement test pauses the consumer before the final request is enqueued, then re-measure.
  2. Fix the payload estimator to compute the retained saved-session JSON byte count, not zero.
  3. Check the receipt's retained_queued_requests and estimated_retained_payload_bytes to see which side is zero before digging into the test.

Example fix

// receipt (before)
"retained_queued_requests": 0, "estimated_retained_payload_bytes": 0
// receipt (after)
"retained_queued_requests": 128, "estimated_retained_payload_bytes": 8388608
Defensive patterns

Strategy: validation

Validate before calling

if receipt["retained_queued_requests"] == 0 or receipt["estimated_retained_payload_bytes"] == 0:
    sys.exit("paused retention not exercised; verify pause ordering and the payload estimator")

Try / catch

try:
    validate_receipt(receipt)
except PersistenceBacklogError as e:
    if "must retain the newest request" in str(e):
        raise RuntimeError("queue drained or estimator zero; fix test sequencing") from e
    raise

Prevention

When it happens

Trigger: The consumer not being paused (queue drained) when the final request was sent; the payload estimator (retained-saved-session-json-bytes-v1) returning 0 because the session JSON was empty or the estimator read the wrong field; measurement aborting before the pause phase.

Common situations: Pause/apply sequencing broken by an actor refactor; estimator broken after the serialized session format changed; test ordering issues under --test-threads=1 changes.

Related errors


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