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

Redirect stdout to the logger system for the Datalayer service #14346

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

emlowe
Copy link
Contributor

@emlowe emlowe commented Jan 13, 2023

When using CLI to stop datalayer, a BrokenPipeError would be displayed on the console.

chia_data_layer: Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'> BrokenPipeError: [Errno 32] Broken pipe

This was caused by some code being run by the process that was print ing to stdout, but stdout didn't have anywhere to go.

This code creates a fake stream object to redirect stdout to the log file resolves this. This is done conditionally only if stdout is not a TTY. This means that if you directly run the service (chia_data_layer / start_data_layer) you will get some prints to stdout - but if you use chia start data those are redirected to the log system

Fixes #13543

@emlowe emlowe requested a review from a team as a code owner January 13, 2023 20:52
@emlowe emlowe added the Fixed Required label for PR that categorizes merge commit message as "Fixed" for changelog label Jan 13, 2023
@emlowe emlowe requested a review from altendky January 13, 2023 21:05
@github-actions
Copy link
Contributor

This PR has been flagged as stale due to no activity for over 60 days. It will not be automatically closed, but it has been given a stale-pr label and should be manually reviewed by the relevant parties.

@github-actions github-actions bot added the stale-pr Flagged as stale and in need of manual review label Feb 28, 2023
@wallentx wallentx closed this Mar 5, 2023
@wallentx wallentx reopened this Mar 5, 2023
@github-actions github-actions bot added the merge_conflict Branch has conflicts that prevent merge to main label Apr 12, 2023
@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the stale-pr Flagged as stale and in need of manual review label Oct 13, 2023
Copy link
Contributor

This PR has been flagged as stale due to no activity for over 60 days. It will not be automatically closed, but it has been given a stale-pr label and should be manually reviewed by the relevant parties.

@github-actions github-actions bot added the stale-pr Flagged as stale and in need of manual review label Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed Required label for PR that categorizes merge commit message as "Fixed" for changelog merge_conflict Branch has conflicts that prevent merge to main stale-pr Flagged as stale and in need of manual review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] BrokenPipeError when stopping data_layer from CLI
2 participants