Skip to content

feat(driver)!: accept multi#747

Merged
Berrysoft merged 6 commits intocompio-rs:masterfrom
Berrysoft:dev/accept-multi
Mar 11, 2026
Merged

feat(driver)!: accept multi#747
Berrysoft merged 6 commits intocompio-rs:masterfrom
Berrysoft:dev/accept-multi

Conversation

@Berrysoft
Copy link
Member

Have to refactor the set_result mechanism to avoid fd leaks.

@Berrysoft Berrysoft self-assigned this Mar 7, 2026
@Berrysoft Berrysoft added driver: io-uring About the io-uring driver driver: polling About the polling driver driver: fusion About the fusion driver package: driver Related to compio-driver labels Mar 7, 2026
@Berrysoft Berrysoft mentioned this pull request Mar 7, 2026
10 tasks
@Berrysoft Berrysoft marked this pull request as ready for review March 8, 2026 09:39
@Berrysoft Berrysoft requested a review from Copilot March 8, 2026 09:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors how fd-returning operations handle completion/cancellation to prevent descriptor leaks, and adds a multishot accept operation (AcceptMulti) to the driver API.

Changes:

  • Replace the previous set_result-style “store fd inside op” mechanism with an explicit drop_result hook and op.result(...) extraction helpers.
  • Add Proactor::cancel_ignore and update runtime/tests/callers to use it so successful-but-ignored results can be disposed (e.g., close fds).
  • Introduce AcceptMulti and wire it up across unix/iouring/poll/stub, plus add coverage in driver tests.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
compio/examples/driver.rs Update example to use op.result(...) for OpenFile instead of into_inner().
compio-runtime/src/runtime/mod.rs Switch runtime cancellation to cancel_ignore to dispose ignored results.
compio-net/src/socket.rs Update socket creation/accept to use op.result(...) for fd ownership transfer.
compio-fs/src/open_options/unix.rs Update OpenFile completion handling to use op.result(...).
compio-driver/tests/personality.rs Update test helper to use op.result(...) (no IntoInner).
compio-driver/tests/op.rs Refactor multishot wait helper, switch cancellations to cancel_ignore, add accept_multi test.
compio-driver/src/sys/unix_op.rs Remove stored-fd fields; add unsafe result(...) extractors; add AcceptMulti.
compio-driver/src/sys/stub/op.rs Mark AcceptMulti as an OpCode for the stub backend.
compio-driver/src/sys/stub/mod.rs Add a stub drop_result hook to match new driver interface.
compio-driver/src/sys/poll/op.rs Stop storing accepted/created/opened fds in ops; add polling AcceptMulti opcode delegation.
compio-driver/src/sys/poll/mod.rs Add OpCode::drop_result hook and Driver::drop_result dispatcher.
compio-driver/src/sys/poll/extra.rs Remove is_iour() helper from poll Extra.
compio-driver/src/sys/iour/op.rs Rename set_resultdrop_result and add AcceptMulti io_uring opcode support.
compio-driver/src/sys/iour/mod.rs Add Driver::drop_result dispatcher; rename trait hook to drop_result.
compio-driver/src/sys/iour/extra.rs Remove is_iour() helper from io_uring Extra.
compio-driver/src/sys/iocp/mod.rs Add no-op drop_result to match new driver interface.
compio-driver/src/sys/fusion/op.rs Macro tweak to support specifying poll/iour op paths.
compio-driver/src/sys/fusion/mod.rs Forward drop_result to the active fused backend driver.
compio-driver/src/sys/fusion/extra.rs Remove is_iour() helper from fusion Extra.
compio-driver/src/op.rs Export AcceptMulti on unix; narrow managed re-exports when not(io_uring).
compio-driver/src/lib.rs Add cancel_with_extra + cancel_ignore; cancellation now can drop ignored results.
compio-driver/src/key.rs Remove io_uring-only set_result special casing that previously stored fds inside ops.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@Berrysoft Berrysoft marked this pull request as draft March 8, 2026 14:08
@Berrysoft Berrysoft marked this pull request as ready for review March 10, 2026 15:11
@Berrysoft Berrysoft requested a review from Copilot March 10, 2026 15:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@Berrysoft Berrysoft requested a review from George-Miao March 10, 2026 15:36
@Berrysoft Berrysoft changed the title feat(driver): accept multi feat(driver)!: accept multi Mar 10, 2026
Copy link
Member

@George-Miao George-Miao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Berrysoft Berrysoft merged commit 0b322a3 into compio-rs:master Mar 11, 2026
113 of 114 checks passed
@Berrysoft Berrysoft deleted the dev/accept-multi branch March 11, 2026 05:39
@github-actions github-actions bot mentioned this pull request Mar 11, 2026
@Berrysoft Berrysoft added this to the v0.19 milestone Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

driver: fusion About the fusion driver driver: io-uring About the io-uring driver driver: polling About the polling driver package: driver Related to compio-driver

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants