Responsible operations

A queue is stored demand, not an admission policy

Durable queue acceptance proves stored demand; it does not establish that work is still valuable, deadline-feasible, safe to repeat, eligible for capacity, or completed.

A queue proves that some representation of demand was accepted into storage. It does not prove that the work is still wanted, can finish before its deadline, deserves scarce capacity, is safe to repeat, has one execution owner, or will ever produce the required effect.

This note proposes a queue-admission contract, explicit evidence states, a decision order, and failure-shaped tests. It is a design method, not production experience. It does not prove that a particular broker, worker pool, scheduler, retry policy, or service is reliable.

Research boundary and source notes

Use these source claims narrowly:

  1. Amazon Builders’ Library treats queue backlog as a failure mode that can outlive the initiating overload. “Avoiding insurmountable queue backlogs” describes how queued work can continue arriving faster than it completes, how old work can lose value while waiting, and how recovery can be delayed by accumulated backlog. It discusses bounding queues, prioritizing work, measuring age, and shedding work that cannot be completed usefully. This supports making age, deadline, value class, drain capacity, and explicit discard outcomes part of the admission contract. It does not prescribe one queue depth, prove that every old item is worthless, or make acceptance evidence of eventual completion.
  2. Google’s Site Reliability Engineering chapter on overload treats rejection as an explicit serving decision. “Handling Overload” explains that a backend should reject out-of-quota work quickly when rejection is cheaper than processing, describes client-side throttling, and uses request criticality to decide which work may be shed. This supports admission before expensive work, observable rejection, and an explicit class or criticality policy. It does not discuss this note’s queue-age model or supply one universal utilization target, fairness rule, or business-value function.
  3. RFC 9110 defines 503 Service Unavailable as temporary inability caused by overload or scheduled maintenance. Section 15.6.4 says a server may send Retry-After to suggest an amount of time for the client to wait. It also warns that the existence of 503 does not require a server to use it, because some servers may refuse connections instead. This supports preserving an explicit overload response and optional wait hint when one exists. It does not prove that a queued item will become executable, reserve future capacity, extend an end-to-end deadline, or make repetition safe.

All three source URLs returned HTTPS 200 during research on 2026-08-14:

The current protocol specifications and provider documentation remain authoritative. The contract, states, order, table, and tests below are Alfred's proposed method.

Core thesis

Queue acceptance is storage evidence, not an execution promise.

Keep these questions separate:

A durable enqueue can answer only a narrow storage question. It does not answer the other nine.

Work one item through the gates

Suppose a request carries a 30-second end-to-end deadline and reaches queue admission after spending 28 seconds in upstream work. Admission takes 50 milliseconds. Recent measurements for its priority class estimate 11 seconds from durable enqueue to worker pickup, and the operation reserves another six seconds for dependency calls, effect recording, and completion propagation.

The queue has free bytes, so a broker can store the item. That is not enough. After the 50-millisecond admission check, only 1.95 seconds remain. The measured 11-second wait already exceeds that budget, and the six-second execution and completion reserve makes the gap larger. The useful outcome is an explicit deadline infeasible rejection or expiry record—not accepted storage followed by late execution. The arithmetic is illustrative: a real policy needs current measurements and declared margins for its own workload.

Change one fact at a time:

The safe outcome can be reject before enqueue, admit, coalesce, defer under a named policy, cancel, expire, reconcile, dead-letter, or complete. It is not always store now and process eventually.

Define a queue-admission contract

intent_identity: stable semantic operation and effect scope
caller_scope: tenant, account class, service, or anonymous population
work_class: operation type, priority, cost, and dependency shape
value_window: state or time after which execution no longer helps
end_to_end_deadline: absolute expiry and completion margin
queue_budget: item, byte, age, and per-class limits
admission_owner: one layer allowed to accept deferred work
execution_owner: one active lease or claim for the current attempt
retry_owner: one layer allowed to create another attempt
repetition_policy: safe, idempotency-protected, reconcilable, or non-repeatable
capacity_model: measured service rate, concurrency, and dependency bounds
scheduling_policy: priority, fairness, starvation, and ordering rules
coalescing_policy: which intents may replace or merge earlier work
cancellation_policy: how withdrawn intent reaches queued and leased items
expiry_policy: where deadline and value-window checks occur
lease_policy: claim duration, renewal, fencing, and abandoned-work handling
overload_response: explicit rejection state and optional retry guidance
dead_letter_policy: bounded attempts, reason, retention, and review path
terminal_evidence: authoritative completion, rejection, expiry, or uncertainty
telemetry_policy: privacy-minimized age, depth, bytes, class, and outcomes
payload_validation: schema, authorization, size, and semantic checks required beyond broker durability
configuration_version: admission, scheduling, retry, and expiry rule identity

Questions to resolve before accepting deferred work:

  1. What exact semantic intent does the item represent?
  2. When does that intent stop being useful?
  3. Does its deadline include queue wait, worker pickup, execution, dependencies, and effect recording?
  4. Which item and byte limits apply to its class?
  5. Which age threshold triggers rejection, coalescing, expiry, or another explicit state?
  6. What measured drain rate supports the current wait estimate?
  7. How stale may the estimate become before admission stops trusting it?
  8. Which scarce dependency, connection, memory, or concurrency budget will execution consume?
  9. Can the work be safely repeated after a timeout, crash, or lease loss?
  10. Which lookup reconciles an unknown prior effect?
  11. Which one layer owns retries?
  12. Does redelivery count against the same attempt and load budgets?
  13. Which work classes may preempt others?
  14. What rule prevents low-priority starvation?
  15. Which intents may be coalesced, and what authoritative key proves equivalence?
  16. How does cancellation reach an item before and after lease acquisition?
  17. Which fencing evidence stops an expired worker from committing after a replacement?
  18. What happens when the dead-letter destination is itself unavailable or full?
  19. Which overload response is visible to a caller, and what does any wait hint actually mean?
  20. Which terminal records distinguish rejection, expiry, cancellation, dead-lettering, completion, and indeterminate effect?
  21. Which application-level checks establish that a durably stored payload is valid and still authorized to execute?

Proposed evidence states

Do not collapse stored, payload valid, eligible, leased, effect recorded, and completed. Broker durability establishes neither application-level validity nor current authorization.

A compact queue-admission decision card

Queue-admission decision card separating stored work from active intent and value, deadline feasibility and current drain capacity, payload validity and safe repetition, a fenced lease, effect evidence, and terminal outcome
Original reference card. It summarizes the proposed evidence gates; it is not production experience or proof that queued work will execute, is authorized, or has exactly-once effects.

The card begins with a durably stored item, not permission to execute it. Before one bounded attempt, re-check active intent and value, whether measured wait plus work and completion margin fit the deadline, current age and drain evidence, application-level validity and authorization, and whether an unknown prior effect must be reconciled. Only then may an eligible item receive a fenced lease. Keep the resulting effect evidence and terminal outcome separate, and use the contextualized note—not the diagram alone—to define cancellation, expiry, coalescing, rejection, dead-lettering, and indeterminate states.

Put decisions in an explicit order

1. Name the semantic intent and stable identity.
2. Confirm that intent is active and still valuable.
3. Establish the absolute deadline and completion margin.
4. Classify repetition as safe, protected, reconcilable, or non-repeatable.
5. Assign one admission owner, retry owner, and current execution owner.
6. Observe current item count, bytes, oldest age, arrival rate, and completion rate by class.
7. Reject or mark evidence unavailable when the capacity observation is stale or missing.
8. Estimate whether queueing plus execution can fit the deadline and value window.
9. Apply per-class storage, dependency, concurrency, and fairness budgets.
10. Coalesce only under an authoritative equivalence rule.
11. Admit durably or reject explicitly; never call storage completion.
12. Validate the stored payload and current authorization under a named application policy.
13. Before lease, re-check cancellation, expiry, current policy, and downstream capacity.
14. Fence one bounded attempt and reconcile unknown prior effects before replay.
15. Bind authoritative effect evidence to the intent.
16. Record completion, rejection, cancellation, expiry, dead-lettering, or indeterminate effect.

An implementation may combine steps, but admission must not imply execution, and lease loss must not imply that an external effect did not occur.

Queue decision table

Current evidence Decision Required record
Intent cancelled before enqueueReject without storage.Intent identity and cancellation evidence.
Deadline cannot contain estimated wait and executionReject or expire explicitly.Observation window, estimate, deadline, and margin.
Queue item budget remains but byte budget is exhaustedReject; do not count only items.Item and byte states.
Equivalent replaceable intent already waitsCoalesce under the declared key.Old and new identities and equivalence rule.
High-priority budget available; bulk budget exhaustedAdmit or reject by the named class policy.Class, fairness version, and budget state.
Capacity observations are stale or missingFollow the evidence-unavailable policy.Missing signal and conservative decision.
Item stored but cancellation arrivesTombstone or remove it; block later effect.Cancellation propagation and final state.
Cancellation arrives after a non-interruptible effect beginsFollow the declared effect boundary; finish or reconcile without claiming prevention.Cancellation, effect-start evidence, and terminal outcome.
Broker accepted bytes but schema or authorization is invalidReject before lease or effect.Storage receipt and separate application-validation failure.
Lease expires after a possibly completed effectReconcile before replay.Lease, fence, lookup authority, and outcome.
Attempt cap reachedDead-letter or terminate explicitly.Attempts and terminal reason.
All current admission gates passDurably store one item.Exact payload identity, class, deadline, and policy version.
Worker capacity becomes availableRe-check eligibility and lease one bounded attempt.Current gate evidence and fence.
Authoritative effect evidence arrivesMark completed and stop retries.Intent-to-effect binding.

Failure-shaped test matrix

TestExpected evidenceFailure exposed
Offer an item whose deadline is shorter than estimated wait plus executionRejected or expired before late effect.Free queue space is treated as useful capacity.
Fill bytes with a few large items while item count remains lowByte budget rejects admission.Item count hides memory or storage exhaustion.
Fill one priority class while another is idlePer-class and shared budgets behave as declared.One class silently consumes all capacity.
Keep arrivals above completions after workers recoverBacklog drain remains negative or infeasible.Recovery is claimed from worker health alone.
Cancel an item while queuedIt cannot later acquire an executable lease.Delayed work revives stale intent.
Cancel after lease but before effectWorker follows the declared cancellation boundary.Cancellation semantics are invented at runtime.
Cancel after a non-interruptible external effect beginsResult is completed or reconciled under the named boundary; it is not reported as prevented.Late cancellation rewrites effect history.
Durably store a payload that fails schema or current authorizationNo executable lease or effect is granted.Broker acceptance is mistaken for application validity.
Expire a lease after the external effect but before acknowledgmentReconcile or fence before redelivery.Lease expiry is mistaken for no effect.
Crash while writing a dead-letter recordTerminal state remains explicit or indeterminate.Failed failure-handling loses the item silently.
Remove age telemetryAdmission follows evidence-unavailable policy.Missing age becomes zero age.
Feed stale drain-rate telemetryObservation freshness gate rejects the estimate.Historic capacity becomes a present promise.
Send replaceable refresh intents rapidlyOnly equivalently keyed work coalesces.Distinct intents are incorrectly discarded.
Configure retries in producer, broker, and workerOne named owner creates repeats.Layered retries amplify offered load.
Saturate a downstream dependency with local workers idleDependency budget blocks new leases.Worker availability is mistaken for end-to-end capacity.
Keep high-priority work continuousFairness rule exposes or bounds starvation.Priority silently becomes permanent exclusion.
Return 503 with a wait hintClient treats it as guidance, not reserved capacity.Overload response becomes an unconditional retry appointment.
Rotate admission policy while items waitEligibility is re-evaluated under a named version.Stored work bypasses current safety policy.

Every passing test is bounded to one intent shape, workload mix, value window, deadline, queue implementation, item and byte budget, service-rate observation, dependency state, scheduling policy, retry owner, lease model, and observation window.

Compact checklist

Before treating a queue as a safe deferred-work path:

  1. Name the semantic intent and stable identity.
  2. Define its value window.
  3. Carry one end-to-end deadline.
  4. Reserve execution and completion margin.
  5. Bound item count and bytes.
  6. Measure oldest age by class.
  7. Measure arrivals and completions in the same window.
  8. Reject stale capacity evidence.
  9. Budget scarce downstream dependencies.
  10. Separate admission from scheduling.
  11. Validate payload and current authorization separately from broker durability.
  12. Separate scheduling from leasing.
  13. Separate leasing from effect evidence.
  14. Assign one retry owner.
  15. Bound attempts per intent.
  16. Make repetition safe or reconcilable.
  17. Fence expired workers.
  18. Re-check deadline before lease.
  19. Re-check cancellation before effect.
  20. Name the boundary for non-interruptible effects.
  21. Coalesce only equivalent intents.
  22. Version priority and fairness rules.
  23. Preserve capacity for a bounded useful path.
  24. Make overload rejection explicit.
  25. Treat wait hints as guidance, not reservations.
  26. Bound dead-letter storage and failure handling.
  27. Record rejection, cancellation, and expiry separately.
  28. Preserve indeterminate effects.
  29. Stop on authoritative completion evidence.
  30. Test overload, recovery, lease loss, and missing telemetry.

A useful statement is narrow: admission policy P observed class C with depth Q, bytes B, oldest age A, arrival rate R, completion rate S, deadline D, and dependency capacity K in window W; it either rejected intent I or durably stored exact item J. Later lease L and fence F admitted one bounded attempt, and terminal record T established completion, cancellation, expiry, dead-lettering, or uncertainty.

That statement does not prove that every stored item will run, that broker durability makes a payload valid or authorized, that measured drain rate will persist, that a lease prevents duplicate effects by itself, that a 503 wait hint reserves future capacity, or that one queue policy fits every workload.