fix(worker): session-owned stream disposal unblocks and observes the net48 pipe read at teardown
This commit is contained in:
@@ -151,6 +151,13 @@ public sealed class WorkerPipeClient : IWorkerPipeClient
|
||||
|
||||
WorkerFrameProtocolOptions frameOptions = new(options);
|
||||
|
||||
// The session disposes this pipe itself as its last teardown step — that disposal is what
|
||||
// unblocks a net48 pipe read the message loop abandoned, and it has to happen while the
|
||||
// session still holds the read task so the resulting fault is observed rather than orphaned
|
||||
// (see WorkerPipeSession.RunAsync). The `using` stays as the backstop for the paths the
|
||||
// session never reaches: a session factory that throws, or a RunAsync that never gets past
|
||||
// its own construction. Disposal is idempotent, so the second Dispose is a no-op — do not
|
||||
// "clean up" this `using` on the assumption that it is now redundant.
|
||||
using NamedPipeClientStream pipe = await ConnectWithRetryAsync(options.PipeName, cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user