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

pathlogical behavior when stdout is redirected to /dev/null #1918

Open
tamird opened this issue Jan 14, 2024 · 1 comment
Open

pathlogical behavior when stdout is redirected to /dev/null #1918

tamird opened this issue Jan 14, 2024 · 1 comment
Labels

Comments

@tamird
Copy link

tamird commented Jan 14, 2024

There's something about GitHub's OpenAI schema that causes yq to hang or at least become very slow but only when stdout is redirected to /dev/null. Weird stuff.

Repro:

# fast
$ curl -sfSL https://raw.githubusercontent.com/github/rest-api-description/618ddb1c3ca74ad843b8dd7a4b3c80dcec298c54/descriptions/ghes-3.6/ghes-3.6.yaml | yq eval . > echo.yml
# hangs
$ curl -sfSL https://raw.githubusercontent.com/github/rest-api-description/618ddb1c3ca74ad843b8dd7a4b3c80dcec298c54/descriptions/ghes-3.6/ghes-3.6.yaml | yq eval . > /dev/null
$ uname -a
Darwin Tamirs-MBP 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:55:06 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6020 arm64

Reproduces both with yq installed from homebrew and compiled from source.

@tamird
Copy link
Author

tamird commented Jan 14, 2024

Looks like this is caused by colorization somehow. --no-colors makes this fast in all cases. I think this has to do with the double pass required for colorization:

return colorizeAndPrint(tempBuffer.Bytes(), writer)
.

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

No branches or pull requests

1 participant