Skip to content

refactor(channel): replace remaining Tokio channels with Crossfire - #242

Open
YuMo12268 wants to merge 1 commit into
stack-rs:suite-agentfrom
YuMo12268:ipc-crossfire
Open

YuMo12268 wants to merge 1 commit into
stack-rs:suite-agentfrom
YuMo12268:ipc-crossfire

Conversation

@YuMo12268

Copy link
Copy Markdown
  • Replace the remaining Tokio mpsc and oneshot channels used for internal message passing with Crossfire channels.

@un-lock-able un-lock-able left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please re-check that in all of your changes (and also all other channel usage in our code) that we use the correct variant of spsc, mpsc and mpmc channel; Also, we prefer unbounded channels over bounded ones because they won't introduce deadlocks. If using an unbounded channel won't cause memory to grow infinitely, we shall always use the unbounded ones.

Comment thread netmito/src/executor.rs

// Compress possible output and upload
let (tx, mut rx) = mpsc::channel::<(ArtifactContentType, u64)>(3);
let (tx, rx) = crossfire::mpmc::bounded_async::<(ArtifactContentType, u64)>(3);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This actually should not be bounded as it may introduce unexpected deadlock. Please change it to unbounded channel in crossfire; Also, the channel is actually used as an spsc channel, so please switch to it.

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