Skip to content

fix: retain caller resources until native read completion - #20

Merged
overtrue merged 2 commits into
mainfrom
overtrue/uring-completion-owner
Nov 30, 2026
Merged

overtrue merged 2 commits into
mainfrom
overtrue/uring-completion-owner

Conversation

@overtrue

@overtrue overtrue commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

A resource lease kept in the caller future is released when that future is dropped, even while io_uring still owns the read. This adds an opt-in owner that follows the read through admission, submission, and final completion. It is needed by the physical-disk admission work in rustfs/rustfs#8911.

The owner moves through the existing queue and pending table without a new per-read allocation or task. It survives cancellation and request-runtime shutdown, stays retained if bounded shutdown cannot resolve the read, and never follows the returned bytes. Existing driver constructors and read request literals keep their current API through unit-owner aliases.

Validation: the original caller-owned pattern failed the native cancellation regression on Linux. The ownership change passed all 156 tests with all features on Linux 6.17/XFS, with no skips, plus 8 ownership tests in a default build. After replacing a deprecated atomic alias with its equivalent method, all 95 unit/shared-budget tests passed again. Formatting, strict Clippy, and rustdoc passed. The replacement atomic method is available below the existing minimum Rust version; no lint allowance or version bump was added.

Review: two sequential passes covered ownership/error paths, cancellation and shutdown, API compatibility, allocation behavior, and regression coverage. No unresolved findings in the change. This PR supplies the driver primitive; RustFS integration and workload performance acceptance are separate.

@overtrue
overtrue merged commit 2deec50 into main Nov 30, 2026
3 checks passed
@overtrue
overtrue deleted the overtrue/uring-completion-owner branch November 30, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants