Skip to content

Conversation

@filzrev
Copy link
Contributor

@filzrev filzrev commented Nov 27, 2025

This PR intended to fix #2873

1. DotNetSdkValidator.cs

Modify code to call ReadToEnd before WaitForExit.

2. ProcessHelper.cs

Remove RedirectStandardError = true setting because stderror is not consumed.

3. ProcessExtensions.cs

Modify code to asynchronously read StandardOutput to support timeout. (ReadToEnd don't support timeout)
And change code to use KillTree when timeout happens. (It might wait 30 seconds if kill signal is not property handled though)

@filzrev filzrev changed the title fix: Process deadlock issue when external command write a lot of output fix: Deadlock issue when invoked external command write a lot of output Nov 27, 2025
Copy link
Collaborator

@timcassell timcassell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @filzrev

@timcassell timcassell merged commit 53a8f77 into dotnet:master Nov 27, 2025
9 checks passed
@timcassell timcassell added this to the v0.15.8 milestone Nov 27, 2025
Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use the existing helper for that, but it's not a must have.

BTW I was just assigned a week ago to redesign those APIs and make sure .NET users don't run into such deadlocks. And I am going to use this PR as one example of a bug in popular and mature OSS lib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Running benchmarks hangs at "// Validating benchmarks:" when you have many, many SDKs installed

3 participants