Repository navigation
Description
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
Resourcesand 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:
- Configure
ResourceSource::Sandboxdwithvalid_for_seconds=30. Return{"cpu":8,"mem":8589934592,"storage":10737418240,"xpu":[]}, sample it, and apply the result usingAdxlet::update_capacity. - Return HTTP 200 with
{"cpu":0,"mem":8589934592,"storage":10737418240,"xpu":[]}.ResourceSource::samplereturnsInvalid("CPU and memory must be positive"). - Before the original observation expires, check
accepting_allocations()and callreserve_localfor 2 CPU / 1 MiB / 0 disk. Admission remains open and the reservation succeeds. Release the hold. - Repeat with
{"cpu":8,"mem":0,"storage":10737418240,"xpu":[]}. The zero sample is rejected and the same reservation succeeds; release the hold. - 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
- 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.
- 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?
- How should node/Coordinator state and metrics distinguish observed exhaustion, invalid data, and an unavailable resource source?
- 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
[-]Clarify zero-capacity observations under the existing resource admission TTL[/-][+]Clarify admission semantics for zero-capacity resource observations[/+]fix(resources): accept zero-capacity node observations
!74 merge github-pr-90 into master