Skip to content

ChildProcessReader can bubble up internal exceptions to ChildProcess.Completion #138

@alexrp

Description

@alexrp

try
{
int read;
// TODO: Review exceptions that can be thrown here.
while ((read = await readStream.ReadAsync(array).ConfigureAwait(false)) != 0)
await writeStream.WriteAsync(array.AsMemory(..read)).ConfigureAwait(false);
}
finally
{
ArrayPool<byte>.Shared.Return(array);
// Users of the Stream and TextReader properties might block forever if we do not signal completion on
// the write end of the pipe. We do not signal completion on the read end of the pipe since we want
// users to be able to read all buffered data after the process exits.
await _pipe.Writer.CompleteAsync().ConfigureAwait(false);
}

Under exceptional circumstances, some exception types can slip through here and bubble up to the ChildProcess.Completion task. We should figure out what these exception types are and what the appropriate way to deal with them is (I suspect just turn them into a ChildProcessException).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: processesIssues related to spawning child processes.

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions