Continuation of #1136#1491
Closed
SteveSandersonMS wants to merge 2 commits into
Closed
Conversation
Iteratively refined the PR per inline review:
Client.cs
- Simplify ProcessStderrPump: drop IDisposable, remove _disposeRequested
field, deferred-dispose ContinueWith machinery, and the try/catch
(ObjectDisposedException) in Cancel(). The CancellationTokenSource has
no CancelAfter and no registrations after ReadLineAsync exits, so GC
with the pump is sufficient. Drop the matching
finally { stderrPump.Dispose(); } block in CleanupCliProcessAsync.
- Consolidate PumpAsync catches into one `catch (Exception e) when
(cancellationToken.IsCancellationRequested && e is ...)`.
- Refactor both read loops to `while (await ... is string line)`:
- PumpAsync (stderr pump)
- StartCliServerAsync port-wait loop; EOF handling moves out of the
loop body and triggers via `detectedLocalhostTcpPort is null`.
- Revert error text to `Runtime process exited unexpectedly` and the
three `CLI stderr pump` log messages to `runtime stderr pump` to
match origin/main wording.
- Replace `var detectedLocalhostTcpPort = (int?)null;` with
`int? detectedLocalhostTcpPort = null;`.
Polyfills/DownlevelExtensions.cs
- Add DownlevelTaskExtensions with WaitAsync on Task and Task<T>. Use a
single linked CancellationTokenSource (no separate timeoutCts) and
`CancellationToken cancellationToken = default` to avoid an extra
overload. The Task<T> overload delegates to the Task overload via
`((Task)task).WaitAsync(...)`.
test/Polyfills/TaskExtensions.cs
- Delete the test-only polyfill; the src polyfill now covers Task<T>
for net472 (test pulls Polyfills/*.cs into the test assembly).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
Didn't work. |
Contributor
Cross-SDK Consistency Review ✅This PR modifies only The changes refactor internal stderr handling into a No cross-SDK consistency issues found.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Creating a new PR because the old one was stuck on a CodeQL check