|
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).
cathode/src/core/Processes/ChildProcessReader.cs
Lines 32 to 48 in 69f1c65
Under exceptional circumstances, some exception types can slip through here and bubble up to the
ChildProcess.Completiontask. 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 aChildProcessException).