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 reading logs to complete before calling cmd.Wait #851

Merged
merged 1 commit into from
Jan 4, 2022
Merged

wait for reading logs to complete before calling cmd.Wait #851

merged 1 commit into from
Jan 4, 2022

Conversation

flyer103
Copy link
Contributor

@flyer103 flyer103 commented Jan 4, 2022

Signed-off-by: zhangyifei zhangyifei@koderover.com

What this PR does / Why we need it:

Problem Summary: When reading data from cmd's stdout/stderr, we need to make sure to wait for the data in stdout/stderr to be read before executing cmd.Wait, otherwise cmd.Wait will close the pipe, causing the read |0: file already closed exception message when reading data .

See also: hashicorp/go-plugin#116

What is changed and how it works?

What's Changed: Wait before reading all data of stdout/stderr.

Check List

  • Docs have been added / updated
  • Unit test / Integration test for the changes have been added
  • Manual test (add detailed scripts or steps below)
  • No code

Signed-off-by: zhangyifei <zhangyifei@koderover.com>
Copy link
Contributor

@jamsman94 jamsman94 left a comment

Choose a reason for hiding this comment

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

LGTM

@flyer103 flyer103 merged commit 487fafd into koderover:main Jan 4, 2022
@flyer103 flyer103 mentioned this pull request Jan 4, 2022
@flyer103 flyer103 deleted the fix branch January 13, 2022 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants