Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Use socketpair to implement Process.Start redirection" (#47461) #47644

Merged

Conversation

eiriktsarpalis
Copy link
Member

@eiriktsarpalis eiriktsarpalis commented Jan 29, 2021

Backport of #47461 and #47643 to release/5.0, fixing #46469.

Customer Impact

Multiple customers reporting a Linux regression introduced in .NET 5: if a .NET process spawns a child process with redirected IO, the child process will fail with ENXIO if it attempts to open the /dev/std* file paths. There are no known workarounds other than changing the code of the child process.

Testing

Added a unit test that validates the regressed behaviour.

Risk

Low. This reverts to the IO redirection implementation used in previous .NET Core versions. The revert does not change functional behaviour but could have impact on scalability and responsiveness, per the comments in #47644 (comment). The change is a clean revert, incorporating a test that verifies the regression.

…t#47461)

* Revert dotnet#34861

* reinstate removed test

* Update src/libraries/System.Diagnostics.Process/tests/ProcessStreamReadTests.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>

Co-authored-by: Stephen Toub <stoub@microsoft.com>
@eiriktsarpalis eiriktsarpalis added Servicing-consider Issue for next servicing release review area-System.Diagnostics.Process labels Jan 29, 2021
@eiriktsarpalis eiriktsarpalis added this to the 5.0.x milestone Jan 29, 2021
@eiriktsarpalis eiriktsarpalis self-assigned this Jan 29, 2021
@ghost
Copy link

ghost commented Jan 29, 2021

Tagging subscribers to this area:
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #47461 to release/5.0, fixing #46469.

Customer Impact

Multiple customers reporting a Linux regression introduced in .NET 5: if a .NET process spawns a child process with redirected IO, the child process will fail with ENXIO if it attempts to open the /dev/std* file paths. There are no known workarounds other than changing the code of the child process.

Testing

Added a unit test that validates the regressed behaviour.

Risk

Low. This reverts to the IO redirection implementation used in previous .NET Core versions.

Author: eiriktsarpalis
Assignees: eiriktsarpalis
Labels:

Servicing-consider, area-System.Diagnostics.Process

Milestone: 5.0.x

* Add test validating against regression in dotnet#46469

* fix test bug
@danmoseley
Copy link
Member

@eiriktsarpalis could you please note in the template what is lost by returning to the old behavior -- presumably there was a reason for the original change -- will we break anyone that now depends on it.

@stephentoub
Copy link
Member

could you please note in the template what is lost by returning to the old behavior -- presumably there was a reason for the original change -- will we break anyone that now depends on it.

Prior to that original change, "async" operations performed on a Process' stdin/stdout/stderr stream would a) be async-over-sync (meaning they'd actually be done with sync operations that block thread pool threads) and b) wouldn't be cancelable. The change made it so that async operations on such streams were truly async and were cancelable.

@danmoseley
Copy link
Member

The change made it so that async operations on such streams were truly async and were cancelable.

OK so with this revert, nothing will break? they will simply not cancel successfully when requested to.

@stephentoub
Copy link
Member

they will simply not cancel successfully when requested to

Essentially. Cancellation may not take effect, and thread pool threads may be blocked. The former impacts responsiveness, and the latter impacts scalability.

@danmoseley
Copy link
Member

Another thing you might mention is whether this was a clean revert or needed some hand merging. The latter adds risk.

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.

LGTM, thank you @eiriktsarpalis

@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Feb 4, 2021
@leecow leecow modified the milestones: 5.0.x, 5.0.4 Feb 4, 2021
@Anipik Anipik merged commit 05c6f2f into dotnet:release/5.0 Feb 10, 2021
@eiriktsarpalis eiriktsarpalis deleted the revert-processsocketpair-5.0 branch February 10, 2021 14:12
@ghost ghost locked as resolved and limited conversation to collaborators Apr 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants