Skip to content

fix: a oneshot receiver gets SenderClosed if the remote sender is dropped - #135

Closed
rklaehn wants to merge 1 commit into
rklaehn/remember-receiver-closedfrom
rklaehn/oneshot-sender-closed
Closed

rklaehn wants to merge 1 commit into
rklaehn/remember-receiver-closedfrom
rklaehn/oneshot-sender-closed

Conversation

@rklaehn

@rklaehn rklaehn commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Based on #134.

A remote oneshot::Sender that is dropped without sending finishes the stream at 0 bytes. The receiver currently gets RecvError::Io ("failed to read size") for that, while locally it gets SenderClosed. This maps the empty stream to SenderClosed.

A stream that ends inside a message is still an io error.

@rklaehn
rklaehn marked this pull request as ready for review October 9, 2026 07:11
Comment thread src/rpc.rs
"failed to read size",
))?;
// A sender that is dropped without sending finishes the stream.
let Some(size) = read.read_varint_u64().await? else {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

read_varint_u64 returns None exactly when the stream closes cleanly at 0 bytes. All other errors, e.g. 1 byte then close, will not produce SenderClosed!

@Frando

Frando commented Oct 9, 2026

Copy link
Copy Markdown
Member

This was merged into #130.

@Frando Frando closed this Oct 9, 2026
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