Skip to content

PipeReaderStream.ReadInternal throws AggregateException unexpectedly #70206

@sharwell

Description

@sharwell

Calls to PipeReaderStream.ReadByte are implemented by calling ReadInternal. This is implemented with Task<T>.Resuslt, which wraps any exceptions in AggregateException. I believe most callers are expecting this to behave as though Task<T>.GetAwaiter().GetResult() was used.

ReadResult result = vt.IsCompletedSuccessfully ? vt.Result : vt.AsTask().Result;

Originally found by looking at exception stacks in AB#1530459.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.IO.Pipelinesbuggood first issueIssue should be easy to implement, good for first-time contributorshelp wanted[up-for-grabs] Good issue for external contributors

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions