Skip to content

Broken pipe error while flushing data that has been read #6

Open
@geigerzaehler

Description

@geigerzaehler

The following test results in a BrokenPipe error in writer.write_all although all data has been read.

#[tokio::test]
async fn drop_read_exact() {
    let (mut writer, mut reader) = pipe();

    let write_handle = tokio::spawn(async move {
        writer.write_all(&mut [0u8; 8]).await.unwrap();
    });

    let mut buf = [0u8; 8];
    reader.read_exact(&mut buf).await.unwrap();
    drop(reader);
    write_handle.await.unwrap();
}

I’m looking into how to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions