feat: add adaptive fill admission before I/O timeouts - #59
Merged
Merged
Conversation
leiysky
force-pushed
the
dev/adaptive-fill-admission
branch
from
September 20, 2026 14:56
a77b5b4 to
5ea2918
Compare
A full observation table must not fail cache I/O, and the 100 ms monitor must not be reset by each submit. Observe would_reject now tracks pause and budget policy only. Shared rate ceilings are FillLimits rather than AdaptiveFillOptions.
Keep put competing only for staging. Workers checkpoint old I/O and pace non-essential flush so Adaptive can pause without a monitor thread.
Raise the record ceiling to the packed-credit limit, preserve refill time across sub-tick wakes, and refund only consumed burst. Document that FillLimits are instance-wide.
#57 collapsed BackendIoEngine; the Adaptive pause test now uses IoEngine::for_test.
leiysky
force-pushed
the
dev/adaptive-fill-admission
branch
from
September 20, 2026 16:02
19626bc to
69ccbeb
Compare
leiysky
enabled auto-merge (squash)
September 20, 2026 16:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Slow background work previously continued accepting cache fills until staging saturated or the normal I/O deadline expired. Add optional pre-timeout fill control:
Observereports pressure and hypothetical rejections, whileAdaptivelimits new fills by encoded bytes and record count, pauses on stalled work, and resumes gradually after validation. The default remains disabled.Reads, deletes, accepted writes, and essential reclaim retain their existing paths. Pressure is separate from terminal health. Snapshots expose request age, approximate drain time, phase durations, and admission counters; enabled snapshots take a short controller lock. Configuration, architecture, errors, and benchmark controls document the final contract.
Design Notes
A 100 ms monitor observes a fixed table of worker-owned background requests through admission, result consumption, and validation/publication. Request age and lack of validated progress can pause admission before the original timeout, including when no completion arrives. Configured byte/record budgets use bounded atomic reservations without foreground allocation, clock reads, or controller locks. Enabled modes account for one monitoring stack and their fixed observations. Accepted I/O is never resubmitted, and pressure suppresses optional reinsertion.
These are conservative workload-pressure signals, not a diagnosis of device failure or CPU throttling. Linux device/cgroup and io_uring qualification remains necessary.
Validation:
cargo x check,cargo x test, andcargo x lintpassed on macOS, including real blocked-backend pre-timeout detection, validation-gated recovery, continued reads/deletes, concurrent admission, and extended recovery tests. Fifteen alternating buffered benchmark runs passed; substantial host variability prevents a credible overhead percentage. A separate rate-limited run completed all writes and reads with expected admission rejections.