Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync: improve cancel-safety documentation for mpsc::Sender::send #5947

Merged
merged 3 commits into from
Aug 25, 2023

Conversation

sunshowers
Copy link
Contributor

Motivation

This specific issue (data loss because a send got cancelled) has bitten our team a couple of times over the last few months. We've switched to recommending this kind of reserve pattern instead.

Solution

Update the documentation to make it clear that data loss can occur if a send is cancelled.

This specific issue (data loss because a send got cancelled) has bitten
our team a couple of times over the last few months. We've switched to
recommending this kind of reserve pattern instead.
@github-actions github-actions bot added the R-loom-sync Run loom sync tests on this PR label Aug 25, 2023
tokio/src/sync/mpsc/bounded.rs Outdated Show resolved Hide resolved
@sunshowers
Copy link
Contributor Author

sunshowers commented Aug 25, 2023

The CI issue appears to be due to Rust 1.72, unrelated to this PR.

@Darksonn Darksonn added T-docs Topic: documentation A-tokio Area: The main tokio crate M-sync Module: tokio/sync labels Aug 25, 2023
@hawkw
Copy link
Member

hawkw commented Aug 25, 2023

#5951 should fix the CI issues here, so I'm updating with that change and rerunning CI.

@hawkw hawkw enabled auto-merge (squash) August 25, 2023 21:41
@hawkw hawkw merged commit 0fe24fc into tokio-rs:master Aug 25, 2023
69 checks passed
@sunshowers sunshowers deleted the sender-docs branch August 28, 2023 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-sync Module: tokio/sync R-loom-sync Run loom sync tests on this PR T-docs Topic: documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants