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

Redirecting output from a child process needs to be async #264

Open
vitek-karas opened this issue Dec 5, 2018 · 1 comment
Open

Redirecting output from a child process needs to be async #264

vitek-karas opened this issue Dec 5, 2018 · 1 comment

Comments

@vitek-karas
Copy link

The code in GenerateFunctions starts a new process and redirects both stdout and stderr, but it does so synchronously (ReadToEnd). This can lead to dead-locks if the child process produces lot of output. Since the code reads from stdout first, if the child produces lot of output in stderr eventually it will fill the buffers and effectively deadlock (parent is waiting on stdout to close, child is waiting on stderr to be read from).

This is described in the remarks section for the StandardOutput.

To correctly redirect both stdout and stderr they have to be read asynchronously and in parallel.

Note that this can be easily triggered by setting COREHOST_TRACE=1 before running the build. This setting turns on detailed logging in the dotnet host which writes it to stderr.

@fabiocav fabiocav added this to the Triaged milestone Feb 4, 2019
@fabiocav fabiocav added the bug label Feb 4, 2019
@fabiocav fabiocav modified the milestones: Triaged, Functions Sprint 43 Feb 6, 2019
@jeffhollan
Copy link

@fabiocav I see this was assigned to the sprint with no assignee though. I'm wondering if given some of the new stuff we pop a P1 or a P2 on this?

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

No branches or pull requests

4 participants