Skip to content

Phase 1: add native NOP request lifecycle - #19

Merged
bright2227 merged 2 commits into
mainfrom
feature/native-request-nop
Aug 1, 2026
Merged

Phase 1: add native NOP request lifecycle#19
bright2227 merged 2 commits into
mainfrom
feature/native-request-nop

Conversation

@bright2227

Copy link
Copy Markdown
Owner

Summary

  • add a native Request type with prepared, submitted, completed, and teardown-cancelled states
  • add Ring.prepare_nop(), Ring.submit(), and non-blocking batch Ring.reap()
  • keep each request alive from SQE preparation until its CQE is consumed
  • expose the lifecycle contract in the type stub and focused unit tests

Why

Phase 1 needs request ownership in native structs before real operations can safely move out of CFFI. A NOP is the smallest kernel operation that exercises the complete SQE-to-CQE lifetime without introducing buffer, socket, or cancellation complexity.

The ring owns a reference while a request address is visible to liburing. Reaping the CQE or closing the ring releases that ownership. Ring teardown marks outstanding requests cancelled with -ECANCELED.

Scope

This intentionally does not add blocking waits, asynchronous cancellation, multi-CQE requests, or operation buffers. Those remain separate reviewable milestones.

Validation

  • native extension built against the vendored static liburing
  • ruff check uringloop tests
  • focused native lifecycle suite: 14 passed
  • full suite: 31 passed
  • Python development-mode stress run: 16,000 NOP requests completed
  • git diff --check

@bright2227
bright2227 marked this pull request as ready for review August 1, 2026 18:12
@bright2227
bright2227 merged commit 258c8cb into main Aug 1, 2026
7 checks passed
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.

1 participant