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

Wait for child stream close events #7

Merged
merged 1 commit into from
Jul 22, 2017

Conversation

unitive-jim
Copy link
Owner

Previously we waited just for the child process closed event,
which was documented to be emitted when the streams where closed.
With this commit, we wait for all of events.

This is whistling in the dark, hoping for some magic that will fix
the occasional truncated logs problem.

This commit also includes some instrumentation to show the order
that these events are received. The typical order seems to be:

  1. "child stderr close"
  2. "child stdout close"
  3. "child process exit"
  4. "child process close"

However, sometimes the order is:

  1. "child stderr close"
  2. "child process exit"
  3. "child process close"
  4. "child stdout close"

If log truncation happened only with child stdout, I might rationalize
the this ordering of events could be the smoking gun for the bug. But we have
been observing log truncation when cranking up the debug log output, which
has been using stderr.

Previously we waited just for the child process closed event,
which was documented to be emitted when the streams where closed.
With this commit, we wait for all of events.

This is whistling in the dark, hoping for some magic that will fix
the occasional truncated logs problem.

This commit also includes some instrumentation to show the order
that these events are received. The typical order seems to be:

1. "child stderr close"
2. "child stdout close"
3. "child process exit"
4. "child process close"

However, sometimes the order is:

1. "child stderr close"
2. "child process exit"
3. "child process close"
4. "child stdout close"

If log truncation happened only with child stdout, I might rationalize
the this ordering of events could be the smoking gun for the bug. But we have
been observing log truncation when cranking up the `debug` log output, which
has been using `stderr`.
@unitive-jim
Copy link
Owner Author

Matt, I'm tempted to merge this even though I am not confident it will help. Thoughts?

Copy link
Collaborator

@mhfrantz mhfrantz left a comment

Choose a reason for hiding this comment

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

LGTM

@mhfrantz mhfrantz merged commit 36e11f1 into master Jul 22, 2017
@mhfrantz mhfrantz deleted the feature/wait-for-child-stream-closed-events branch July 22, 2017 00:12
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.

2 participants