Skip to content

Conversation

@smalis-msft
Copy link
Contributor

@smalis-msft smalis-msft commented Dec 17, 2025

We generally believe that async_channel has better performance characteristics than futures channels, but the semantics are slightly different. Let's see what happens here.

Also move one channel in netvsp from futures to mesh, since it was unbounded and doesn't need any of futures' semantics.

@smalis-msft smalis-msft requested a review from a team as a code owner December 17, 2025 21:25
Copilot AI review requested due to automatic review settings December 17, 2025 21:25
@smalis-msft smalis-msft requested a review from a team as a code owner December 17, 2025 21:25
@github-actions github-actions bot added the unsafe Related to unsafe code label Dec 17, 2025
@github-actions
Copy link

⚠️ Unsafe Code Detected

This PR modifies files containing unsafe Rust code. Extra scrutiny is required during review.

For more on why we check whole files, instead of just diffs, check out the Rustonomicon

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 experimental PR migrates from futures::channel to async_channel across the mesh and pal subsystems to potentially improve performance characteristics. The changes replace oneshot channels with bounded(1) channels and unbounded mpsc channels with async_channel equivalents.

Key changes:

  • Replace futures::channel::oneshot with async_channel::bounded(1)
  • Replace futures::channel::mpsc::unbounded with async_channel::unbounded
  • Update method calls from unbounded_send() to send_blocking() or send().await

Critical compilation issues identified:

  • async_channel::Receiver does not implement the Stream trait, causing compilation failures where .next() or .poll_next() are called on receivers
  • Two locations affected: alpc_node.rs line 233 and existing code dependent on changes in local_node.rs line 2494

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Cargo.toml Removes futures-channel workspace dependency
Cargo.lock Updates dependencies: adds async-channel to mesh_node, mesh_remote, and pal_uring
support/mesh/mesh_node/Cargo.toml Replaces futures-channel with async-channel dependency
support/mesh/mesh_node/src/local_node.rs Replaces oneshot and mpsc channels with async_channel; adds explicit close() call for shutdown signaling
support/mesh/mesh_remote/Cargo.toml Adds async-channel dependency
support/mesh/mesh_remote/src/alpc_node.rs Converts mpsc::unbounded to async_channel with Stream usage that won't compile
support/mesh/mesh_remote/src/unix_node.rs Converts mpsc channels to async_channel; changes send operations from non-blocking to async
support/pal/pal_async/src/executor_tests.rs Converts oneshot test channels to bounded(1) async_channel
support/pal/pal_uring/Cargo.toml Adds async-channel as dev-dependency
support/pal/pal_uring/src/threadpool.rs Converts test oneshot channels to bounded(1) async_channel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

unsafe Related to unsafe code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant