Skip to content

Clarify admission semantics for zero-capacity resource observations #113

Open

Description

@rcyw

Question

How should adxlet interpret a successfully read resource observation containing zero CPU or zero memory, and how should that observation affect new admission while a previous positive observation is still within its validity period?

This issue evaluates the resource-observation and admission contract. Whether an implementation change is needed, and what policy it should implement, remain open decisions.

Current behavior

  • Sandboxd's Kubernetes resource provider derives capacity from Node Allocatable minus Pod requests. CPU is reported in whole cores, so zero can also represent a positive remainder smaller than one core.
  • ADX converts the response into Resources and applies its positive CPU/memory validation. A response containing zero CPU or zero memory is rejected as an invalid observation.
  • The existing sampling policy retains the previous successful observation until its original validity period expires, then closes new admission. A rejected zero sample follows this same path; it does not start a new validity period.

The failure/expiry policy is documented in adxlet lifecycle. The resource-source parser is in adxlet resources.rs.

Existing component evidence

The previously recorded local experiment used the actual ADX library at b208c40964934ba24e04e80136d9f077bddb44f5, an HTTP Unix-socket fixture, and an isolated Adxlet whose runtime/readiness/routes/state dependencies were unused stubs.

A minimal reproduction using those component APIs is:

  1. Configure ResourceSource::Sandboxd with valid_for_seconds=30. Return {"cpu":8,"mem":8589934592,"storage":10737418240,"xpu":[]}, sample it, and apply the result using Adxlet::update_capacity.
  2. Return HTTP 200 with {"cpu":0,"mem":8589934592,"storage":10737418240,"xpu":[]}. ResourceSource::sample returns Invalid("CPU and memory must be positive").
  3. Before the original observation expires, check accepting_allocations() and call reserve_local for 2 CPU / 1 MiB / 0 disk. Admission remains open and the reservation succeeds. Release the hold.
  4. Repeat with {"cpu":8,"mem":0,"storage":10737418240,"xpu":[]}. The zero sample is rejected and the same reservation succeeds; release the hold.
  5. As a control, sample and apply a positive 1-core observation with sufficient memory. The same 2-core reservation returns NoCapacity.

These observations characterize the current component behavior. No runtime was started, Kubernetes exhaustion was not injected, and no OOM or start failure was reproduced. The real-cluster operational impact remains unverified. All fixture sockets and temporary local holds were released.

Questions for the later evaluation

  1. Should a zero-capacity response be a valid exhaustion observation, or should it retain the current invalid-sample treatment? Distinguish actual exhaustion from CPU-unit rounding before deciding.
  2. If zero is accepted as an observation, should it immediately supersede cached positive capacity? If the current grace period is retained, what is its intended availability/admission tradeoff?
  3. How should node/Coordinator state and metrics distinguish observed exhaustion, invalid data, and an unavailable resource source?
  4. How should positive observations restore admission without disturbing existing executions or resource reservations?

Evaluate these choices with CPU-zero, memory-zero, sub-core remainder, transport failure, malformed data, TTL expiry and recovery cases. Existing transport-failure tolerance and reservation accounting should be considered separately from any zero-observation policy change.

The next step is a separate design and behavior evaluation, followed by a documented decision and appropriate tests. This issue does not prescribe an immediate admission-close fix or classify the existing TTL policy as a confirmed defect.

Activity

  1. changed the title [-]Clarify zero-capacity observations under the existing resource admission TTL[/-] [+]Clarify admission semantics for zero-capacity resource observations[/+] on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions