You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix stderr drain cancelled prematurely by CancelShutdown race
GetUnexpectedExitExceptionAsync used a linked CancellationTokenSource
that included the caller's token (_shutdownCts.Token). When
ReadMessagesAsync and DisposeAsync race to call CleanupAsync, the
loser calls CancelShutdown() which cancels _shutdownCts. This
prematurely aborted WaitForExitAsync in the winner's cleanup path,
preventing stderr pipe buffers from being fully drained. The
ErrorDataReceived callback would never fire for lines still in the
pipe, causing CreateAsync_ValidProcessInvalidServer_StdErrCallbackInvoked
to fail intermittently.
Fix: use a standalone timeout CTS instead of linking to the caller's
token. The process is already dead at this point—we only need a
timeout to bound the pipe drain, not external cancellation.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments